Explain why we shouldn't add inline attr to into_vec

This commit is contained in:
Yuki Okushi 2020-04-19 01:03:43 +09:00
parent 339a938fa6
commit 1a46159828
No known key found for this signature in database
GPG Key ID: B0986C85C0E2DAA1
1 changed files with 3 additions and 0 deletions

View File

@ -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();