1
Fork 0

Rollup merge of #71287 - JohnTitor:comment-vec, r=RalfJung

Explain why we shouldn't add inline attr to into_vec

Follow-up of #71204
r? @RalfJung
This commit is contained in:
Dylan DPC 2020-04-19 01:04:54 +02:00 committed by GitHub
commit dfdfc76cd9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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