From 29c8eef74ff747467584e3ae8d75e23677f9c61c Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Wed, 21 Aug 2024 22:30:16 +0200 Subject: [PATCH] const_refs_to_cell: dont let mutable references sneak past the interior mutability check --- core/src/slice/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/slice/mod.rs b/core/src/slice/mod.rs index 8b661d1202ce0..c74a7666919b2 100644 --- a/core/src/slice/mod.rs +++ b/core/src/slice/mod.rs @@ -846,7 +846,7 @@ impl [T] { /// [`as_mut_ptr`]: slice::as_mut_ptr #[stable(feature = "slice_ptr_range", since = "1.48.0")] #[rustc_const_stable(feature = "const_ptr_offset", since = "1.61.0")] - #[rustc_allow_const_fn_unstable(const_mut_refs)] + #[rustc_allow_const_fn_unstable(const_mut_refs, const_refs_to_cell)] #[inline] #[must_use] pub const fn as_mut_ptr_range(&mut self) -> Range<*mut T> {