diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2021-12-11 17:35:24 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-12-11 17:35:24 +0100 |
| commit | 40482bb539362e1173bbe2b218ed4c06b11fa4b3 (patch) | |
| tree | 5dc5fe20297fcf35cddab94efaa667b72bee6c3a /library/core/src/array | |
| parent | 7bba5c163c3530d3eeab03128bd1c72d331a16df (diff) | |
| parent | 8f68bdc38024c471f925ce8b6572ec41546229e1 (diff) | |
| download | rust-40482bb539362e1173bbe2b218ed4c06b11fa4b3.tar.gz rust-40482bb539362e1173bbe2b218ed4c06b11fa4b3.zip | |
Rollup merge of #90270 - woppopo:const_borrow_trait, r=dtolnay
Make `Borrow` and `BorrowMut` impls `const` Tracking issue: #91522
Diffstat (limited to 'library/core/src/array')
| -rw-r--r-- | library/core/src/array/mod.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/library/core/src/array/mod.rs b/library/core/src/array/mod.rs index 5e295ffbff7..0e33e95271e 100644 --- a/library/core/src/array/mod.rs +++ b/library/core/src/array/mod.rs @@ -162,14 +162,16 @@ impl<T, const N: usize> AsMut<[T]> for [T; N] { } #[stable(feature = "array_borrow", since = "1.4.0")] -impl<T, const N: usize> Borrow<[T]> for [T; N] { +#[rustc_const_unstable(feature = "const_borrow", issue = "91522")] +impl<T, const N: usize> const Borrow<[T]> for [T; N] { fn borrow(&self) -> &[T] { self } } #[stable(feature = "array_borrow", since = "1.4.0")] -impl<T, const N: usize> BorrowMut<[T]> for [T; N] { +#[rustc_const_unstable(feature = "const_borrow", issue = "91522")] +impl<T, const N: usize> const BorrowMut<[T]> for [T; N] { fn borrow_mut(&mut self) -> &mut [T] { self } |
