Skip to content

Commit

Permalink
Rollup merge of rust-lang#71287 - JohnTitor:comment-vec, r=RalfJung
Browse files Browse the repository at this point in the history
Explain why we shouldn't add inline attr to into_vec

Follow-up of rust-lang#71204
r? @RalfJung
  • Loading branch information
Dylan-DPC committed Apr 18, 2020
2 parents a9b1d22 + 1a46159 commit 08ef326
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/liballoc/slice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@ mod hack {
use crate::string::ToString;
use crate::vec::Vec;

// We shouldn't add inline attribute to this since this is used in
// `vec!` macro mostly and causes perf regression. See #71204 for
// discussion and perf results.
pub fn into_vec<T>(b: Box<[T]>) -> Vec<T> {
unsafe {
let len = b.len();
Expand Down

0 comments on commit 08ef326

Please sign in to comment.