From edab1230088679d30581dcb6902374e97dc5cc73 Mon Sep 17 00:00:00 2001 From: Oli Scherer Date: Tue, 11 Oct 2022 19:11:56 +0000 Subject: [PATCH] Fix some `~const` usage in libcore --- core/src/const_closure.rs | 4 ++-- core/src/hash/mod.rs | 4 ++-- core/src/ops/index.rs | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/core/src/const_closure.rs b/core/src/const_closure.rs index 151c8e6d8..920c31233 100644 --- a/core/src/const_closure.rs +++ b/core/src/const_closure.rs @@ -51,7 +51,7 @@ macro_rules! impl_fn_mut_tuple { impl<'a, $($var,)* ClosureArguments, Function, ClosureReturnValue> const FnOnce for ConstFnMutClosure<($(&'a mut $var),*), Function> where - Function: ~const Fn(($(&mut $var),*), ClosureArguments) -> ClosureReturnValue+ ~const Destruct, + Function: ~const Fn(($(&mut $var),*), ClosureArguments) -> ClosureReturnValue + ~const Destruct, { type Output = ClosureReturnValue; @@ -64,7 +64,7 @@ macro_rules! impl_fn_mut_tuple { impl<'a, $($var,)* ClosureArguments, Function, ClosureReturnValue> const FnMut for ConstFnMutClosure<($(&'a mut $var),*), Function> where - Function: ~const Fn(($(&mut $var),*), ClosureArguments)-> ClosureReturnValue, + Function: ~const Fn(($(&mut $var),*), ClosureArguments)-> ClosureReturnValue + ~const Destruct, { extern "rust-call" fn call_mut(&mut self, args: ClosureArguments) -> Self::Output { #[allow(non_snake_case)] diff --git a/core/src/hash/mod.rs b/core/src/hash/mod.rs index c755afa39..71a0d1825 100644 --- a/core/src/hash/mod.rs +++ b/core/src/hash/mod.rs @@ -199,7 +199,7 @@ pub trait Hash { /// println!("Hash is {:x}!", hasher.finish()); /// ``` #[stable(feature = "rust1", since = "1.0.0")] - fn hash(&self, state: &mut H); + fn hash(&self, state: &mut H); /// Feeds a slice of this type into the given [`Hasher`]. /// @@ -980,7 +980,7 @@ mod impls { #[rustc_const_unstable(feature = "const_hash", issue = "104061")] impl const Hash for &mut T { #[inline] - fn hash(&self, state: &mut H) { + fn hash(&self, state: &mut H) { (**self).hash(state); } } diff --git a/core/src/ops/index.rs b/core/src/ops/index.rs index 5e3dc48b6..228efb0bc 100644 --- a/core/src/ops/index.rs +++ b/core/src/ops/index.rs @@ -165,7 +165,7 @@ see chapter in The Book : Index { +pub trait IndexMut: ~const Index { /// Performs the mutable indexing (`container[index]`) operation. /// /// # Panics