From 8f68bdc38024c471f925ce8b6572ec41546229e1 Mon Sep 17 00:00:00 2001 From: woppopo Date: Sat, 4 Dec 2021 21:57:39 +0900 Subject: Make `Borrow` and `BorrowMut` impls `const` --- library/core/src/array/mod.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'library/core/src/array') diff --git a/library/core/src/array/mod.rs b/library/core/src/array/mod.rs index b27c36baf37..e89659c41ea 100644 --- a/library/core/src/array/mod.rs +++ b/library/core/src/array/mod.rs @@ -149,14 +149,16 @@ impl AsMut<[T]> for [T; N] { } #[stable(feature = "array_borrow", since = "1.4.0")] -impl Borrow<[T]> for [T; N] { +#[rustc_const_unstable(feature = "const_borrow", issue = "91522")] +impl const Borrow<[T]> for [T; N] { fn borrow(&self) -> &[T] { self } } #[stable(feature = "array_borrow", since = "1.4.0")] -impl BorrowMut<[T]> for [T; N] { +#[rustc_const_unstable(feature = "const_borrow", issue = "91522")] +impl const BorrowMut<[T]> for [T; N] { fn borrow_mut(&mut self) -> &mut [T] { self } -- cgit 1.4.1-3-g733a5