diff --git a/library/core/src/convert/mod.rs b/library/core/src/convert/mod.rs index 432e55e8c9a4c..57e41bf73a16b 100644 --- a/library/core/src/convert/mod.rs +++ b/library/core/src/convert/mod.rs @@ -850,6 +850,24 @@ impl AsMut for str { } } +#[cfg(not(bootstrap))] +#[stable(feature = "array_as_ref_impl", since = "CURRENT_RUSTC_VERSION")] +impl AsRef<[T; N]> for [T; N] { + #[inline(always)] + fn as_ref(&self) -> &Self { + self + } +} + +#[cfg(not(bootstrap))] +#[stable(feature = "array_as_ref_impl", since = "CURRENT_RUSTC_VERSION")] +impl AsMut<[T; N]> for [T; N] { + #[inline(always)] + fn as_mut(&mut self) -> &mut Self { + self + } +} + //////////////////////////////////////////////////////////////////////////////// // THE NO-ERROR ERROR TYPE ////////////////////////////////////////////////////////////////////////////////