From 1a461598280f3f0ed047c89d1f2ec10be354e609 Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Sun, 19 Apr 2020 01:03:43 +0900 Subject: [PATCH] Explain why we shouldn't add inline attr to into_vec --- src/liballoc/slice.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/liballoc/slice.rs b/src/liballoc/slice.rs index c13e90a3d7081..53477288b59ee 100644 --- a/src/liballoc/slice.rs +++ b/src/liballoc/slice.rs @@ -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(b: Box<[T]>) -> Vec { unsafe { let len = b.len();