Skip to content

Commit 61b1394

Browse files
committed
Attempt to address perf regressions with #[inline]
1 parent 3024eff commit 61b1394

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

library/core/src/array/mod.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -331,18 +331,20 @@ impl<T: Ord, const N: usize> Ord for [T; N] {
331331
}
332332

333333
#[cfg(not(bootstrap))]
334-
#[stable(feature = "copy_clone_array_lib", since = "1.55.0")]
334+
#[stable(feature = "copy_clone_array_lib", since = "1.58.0")]
335335
impl<T: Copy, const N: usize> Copy for [T; N] {}
336336

337337
#[cfg(not(bootstrap))]
338-
#[stable(feature = "copy_clone_array_lib", since = "1.55.0")]
338+
#[stable(feature = "copy_clone_array_lib", since = "1.58.0")]
339339
impl<T: Clone, const N: usize> Clone for [T; N] {
340+
#[inline]
340341
fn clone(&self) -> Self {
341342
// SAFETY: we know for certain that this iterator will yield exactly `N`
342343
// items.
343344
unsafe { collect_into_array_unchecked(&mut self.iter().cloned()) }
344345
}
345346

347+
#[inline]
346348
fn clone_from(&mut self, other: &Self) {
347349
self.clone_from_slice(other);
348350
}

0 commit comments

Comments
 (0)