Skip to content

Commit 08ef326

Browse files
authored
Rollup merge of rust-lang#71287 - JohnTitor:comment-vec, r=RalfJung
Explain why we shouldn't add inline attr to into_vec Follow-up of rust-lang#71204 r? @RalfJung
2 parents a9b1d22 + 1a46159 commit 08ef326

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/liballoc/slice.rs

+3
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,9 @@ mod hack {
140140
use crate::string::ToString;
141141
use crate::vec::Vec;
142142

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

0 commit comments

Comments
 (0)