]> git.lizzy.rs Git - rust.git/commit
Auto merge of #96711 - emilio:inline-slice-clone, r=nikic
authorbors <bors@rust-lang.org>
Mon, 10 Oct 2022 12:09:21 +0000 (12:09 +0000)
committerbors <bors@rust-lang.org>
Mon, 10 Oct 2022 12:09:21 +0000 (12:09 +0000)
commit0265a3e93bf1b89d97cae113ed214954d5c35e22
treed0d9a4d7dd010de2f14cf0dd38e95c917324bf40
parent691aeaad6c9ee3483f2851695379b348b8a92a43
parent93e587b81791bdd943117b19ade708c9f7193325
Auto merge of #96711 - emilio:inline-slice-clone, r=nikic

slice: #[inline] a couple iterator methods.

The one I care about and actually saw in the wild not getting inlined is
clone(). We ended up doing a whole function call for something that just
copies two pointers.

I ended up marking as_slice / as_ref as well because make_slice is
inline(always) itself, and is also the kind of think that can kill
performance in hot loops if you expect it to get inlined. But happy to
undo those.
library/core/src/slice/iter.rs