rust/src/liballoc
kennytm bf60295211
Rollup merge of #49555 - nox:inline-into-boxed, r=alexcrichton
Inline most of the code paths for conversions with boxed slices

This helps with the specific problem described in #49541, obviously without making any large change to how inlining works in the general case.

Everything involved in the conversions is made `#[inline]`, except for the `<Vec<T>>::into_boxed_slice` entry point which is made `#[inline(always)]` after checking that duplicating the function mentioned in the issue prevented its inlining if I only annotate it with
`#[inline]`.

For the record, that function was:

```rust
pub fn foo() -> Box<[u8]> {
    vec![0].into_boxed_slice()
}
```

To help the inliner's job, we also hoist a `self.capacity() != self.len` check in `<Vec<T>>::shrink_to_fit` and mark it as `#[inline]` too.
2018-04-17 01:50:56 +08:00
..
2018-04-12 22:53:22 +02:00
2018-04-12 22:53:22 +02:00
2018-04-12 00:13:51 +02:00
2018-04-12 22:53:22 +02:00
2017-11-21 15:33:45 +01:00
2018-04-14 08:43:13 +09:00
2018-04-12 22:53:22 +02:00