Skip to content

Commit

Permalink
Auto merge of rust-lang#135384 - saethlin:inline-copy-from-slice, r=j…
Browse files Browse the repository at this point in the history
…oboet

Add #[inline] to copy_from_slice

I'm doing cooked things to CGU partitioning for compiler-builtins (rust-lang#135395) and this was the lone symbol in my compiler-builtins rlib that wasn't an intrinsic. Adding `#[inline]` makes it go away.

Perf report indicates a marginal but chaotic effect on compile time, marginal improvement in codegen. As expected.
  • Loading branch information
bors committed Jan 12, 2025
2 parents 627513a + cda566e commit 48a426e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions library/core/src/slice/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3703,6 +3703,7 @@ impl<T> [T] {
/// [`clone_from_slice`]: slice::clone_from_slice
/// [`split_at_mut`]: slice::split_at_mut
#[doc(alias = "memcpy")]
#[inline]
#[stable(feature = "copy_from_slice", since = "1.9.0")]
#[rustc_const_unstable(feature = "const_copy_from_slice", issue = "131415")]
#[track_caller]
Expand Down

0 comments on commit 48a426e

Please sign in to comment.