about summary refs log tree commit diff
diff options
context:
space:
mode:
authorOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2022-10-11 19:11:56 +0000
committerOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2022-12-20 15:01:37 +0000
commitc787de3bbd307cccbfaeb56421ad7ad898330676 (patch)
treee5447ab13cd9dea36a47d516af08f5111eb0393a
parent872a6da935afa11c9b836d685efd591ca7a64481 (diff)
downloadrust-c787de3bbd307cccbfaeb56421ad7ad898330676.tar.gz
rust-c787de3bbd307cccbfaeb56421ad7ad898330676.zip
Fix some `~const` usage in libcore
-rw-r--r--library/core/src/const_closure.rs4
-rw-r--r--library/core/src/hash/mod.rs4
-rw-r--r--library/core/src/ops/index.rs2
3 files changed, 5 insertions, 5 deletions
diff --git a/library/core/src/const_closure.rs b/library/core/src/const_closure.rs
index 151c8e6d898..920c31233c1 100644
--- a/library/core/src/const_closure.rs
+++ b/library/core/src/const_closure.rs
@@ -51,7 +51,7 @@ macro_rules! impl_fn_mut_tuple {
         impl<'a, $($var,)* ClosureArguments, Function, ClosureReturnValue> const
             FnOnce<ClosureArguments> 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<ClosureArguments> 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/library/core/src/hash/mod.rs b/library/core/src/hash/mod.rs
index c755afa39eb..71a0d1825ef 100644
--- a/library/core/src/hash/mod.rs
+++ b/library/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<H: Hasher>(&self, state: &mut H);
+    fn hash<H: ~const Hasher>(&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<T: ?Sized + ~const Hash> const Hash for &mut T {
         #[inline]
-        fn hash<H: Hasher>(&self, state: &mut H) {
+        fn hash<H: ~const Hasher>(&self, state: &mut H) {
             (**self).hash(state);
         }
     }
diff --git a/library/core/src/ops/index.rs b/library/core/src/ops/index.rs
index 5e3dc48b6ca..228efb0bc0a 100644
--- a/library/core/src/ops/index.rs
+++ b/library/core/src/ops/index.rs
@@ -165,7 +165,7 @@ see chapter in The Book <https://doc.rust-lang.org/book/ch08-02-strings.html#ind
 #[doc(alias = "]")]
 #[doc(alias = "[]")]
 #[const_trait]
-pub trait IndexMut<Idx: ?Sized>: Index<Idx> {
+pub trait IndexMut<Idx: ?Sized>: ~const Index<Idx> {
     /// Performs the mutable indexing (`container[index]`) operation.
     ///
     /// # Panics