diff options
| author | bors <bors@rust-lang.org> | 2021-12-11 18:56:59 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-12-11 18:56:59 +0000 |
| commit | 928783de663bd855a96f14b2d38c1061603587c6 (patch) | |
| tree | 7d15b13b3dc510538db60633b953627bfd0e6df6 /library/core/src/array | |
| parent | b8dc6aa673317cf72a8abb9c421f573f2b34b47a (diff) | |
| parent | ed81098fcca409261db3408115725d07729ac39a (diff) | |
| download | rust-928783de663bd855a96f14b2d38c1061603587c6.tar.gz rust-928783de663bd855a96f14b2d38c1061603587c6.zip | |
Auto merge of #91799 - matthiaskrgr:rollup-b38xx6i, r=matthiaskrgr
Rollup of 6 pull requests Successful merges: - #83174 (Suggest using a temporary variable to fix borrowck errors) - #89734 (Point at capture points for non-`'static` reference crossing a `yield` point) - #90270 (Make `Borrow` and `BorrowMut` impls `const`) - #90741 (Const `Option::cloned`) - #91548 (Add spin_loop hint for RISC-V architecture) - #91721 (Minor improvements to `future::join!`'s implementation) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
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 } |
