Skip to content

Commit c787de3

Browse files
committed
Fix some ~const usage in libcore
1 parent 872a6da commit c787de3

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

library/core/src/const_closure.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ macro_rules! impl_fn_mut_tuple {
5151
impl<'a, $($var,)* ClosureArguments, Function, ClosureReturnValue> const
5252
FnOnce<ClosureArguments> for ConstFnMutClosure<($(&'a mut $var),*), Function>
5353
where
54-
Function: ~const Fn(($(&mut $var),*), ClosureArguments) -> ClosureReturnValue+ ~const Destruct,
54+
Function: ~const Fn(($(&mut $var),*), ClosureArguments) -> ClosureReturnValue + ~const Destruct,
5555
{
5656
type Output = ClosureReturnValue;
5757

@@ -64,7 +64,7 @@ macro_rules! impl_fn_mut_tuple {
6464
impl<'a, $($var,)* ClosureArguments, Function, ClosureReturnValue> const
6565
FnMut<ClosureArguments> for ConstFnMutClosure<($(&'a mut $var),*), Function>
6666
where
67-
Function: ~const Fn(($(&mut $var),*), ClosureArguments)-> ClosureReturnValue,
67+
Function: ~const Fn(($(&mut $var),*), ClosureArguments)-> ClosureReturnValue + ~const Destruct,
6868
{
6969
extern "rust-call" fn call_mut(&mut self, args: ClosureArguments) -> Self::Output {
7070
#[allow(non_snake_case)]

library/core/src/hash/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ pub trait Hash {
199199
/// println!("Hash is {:x}!", hasher.finish());
200200
/// ```
201201
#[stable(feature = "rust1", since = "1.0.0")]
202-
fn hash<H: Hasher>(&self, state: &mut H);
202+
fn hash<H: ~const Hasher>(&self, state: &mut H);
203203

204204
/// Feeds a slice of this type into the given [`Hasher`].
205205
///
@@ -980,7 +980,7 @@ mod impls {
980980
#[rustc_const_unstable(feature = "const_hash", issue = "104061")]
981981
impl<T: ?Sized + ~const Hash> const Hash for &mut T {
982982
#[inline]
983-
fn hash<H: Hasher>(&self, state: &mut H) {
983+
fn hash<H: ~const Hasher>(&self, state: &mut H) {
984984
(**self).hash(state);
985985
}
986986
}

library/core/src/ops/index.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ see chapter in The Book <https://doc.rust-lang.org/book/ch08-02-strings.html#ind
165165
#[doc(alias = "]")]
166166
#[doc(alias = "[]")]
167167
#[const_trait]
168-
pub trait IndexMut<Idx: ?Sized>: Index<Idx> {
168+
pub trait IndexMut<Idx: ?Sized>: ~const Index<Idx> {
169169
/// Performs the mutable indexing (`container[index]`) operation.
170170
///
171171
/// # Panics

0 commit comments

Comments
 (0)