Fix some ~const
usage in libcore
This commit is contained in:
parent
872a6da935
commit
c787de3bbd
3 changed files with 5 additions and 5 deletions
|
@ -51,7 +51,7 @@ macro_rules! impl_fn_mut_tuple {
|
||||||
impl<'a, $($var,)* ClosureArguments, Function, ClosureReturnValue> const
|
impl<'a, $($var,)* ClosureArguments, Function, ClosureReturnValue> const
|
||||||
FnOnce<ClosureArguments> for ConstFnMutClosure<($(&'a mut $var),*), Function>
|
FnOnce<ClosureArguments> for ConstFnMutClosure<($(&'a mut $var),*), Function>
|
||||||
where
|
where
|
||||||
Function: ~const Fn(($(&mut $var),*), ClosureArguments) -> ClosureReturnValue+ ~const Destruct,
|
Function: ~const Fn(($(&mut $var),*), ClosureArguments) -> ClosureReturnValue + ~const Destruct,
|
||||||
{
|
{
|
||||||
type Output = ClosureReturnValue;
|
type Output = ClosureReturnValue;
|
||||||
|
|
||||||
|
@ -64,7 +64,7 @@ macro_rules! impl_fn_mut_tuple {
|
||||||
impl<'a, $($var,)* ClosureArguments, Function, ClosureReturnValue> const
|
impl<'a, $($var,)* ClosureArguments, Function, ClosureReturnValue> const
|
||||||
FnMut<ClosureArguments> for ConstFnMutClosure<($(&'a mut $var),*), Function>
|
FnMut<ClosureArguments> for ConstFnMutClosure<($(&'a mut $var),*), Function>
|
||||||
where
|
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 {
|
extern "rust-call" fn call_mut(&mut self, args: ClosureArguments) -> Self::Output {
|
||||||
#[allow(non_snake_case)]
|
#[allow(non_snake_case)]
|
||||||
|
|
|
@ -199,7 +199,7 @@ pub trait Hash {
|
||||||
/// println!("Hash is {:x}!", hasher.finish());
|
/// println!("Hash is {:x}!", hasher.finish());
|
||||||
/// ```
|
/// ```
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[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`].
|
/// Feeds a slice of this type into the given [`Hasher`].
|
||||||
///
|
///
|
||||||
|
@ -980,7 +980,7 @@ mod impls {
|
||||||
#[rustc_const_unstable(feature = "const_hash", issue = "104061")]
|
#[rustc_const_unstable(feature = "const_hash", issue = "104061")]
|
||||||
impl<T: ?Sized + ~const Hash> const Hash for &mut T {
|
impl<T: ?Sized + ~const Hash> const Hash for &mut T {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn hash<H: Hasher>(&self, state: &mut H) {
|
fn hash<H: ~const Hasher>(&self, state: &mut H) {
|
||||||
(**self).hash(state);
|
(**self).hash(state);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -165,7 +165,7 @@ see chapter in The Book <https://doc.rust-lang.org/book/ch08-02-strings.html#ind
|
||||||
#[doc(alias = "]")]
|
#[doc(alias = "]")]
|
||||||
#[doc(alias = "[]")]
|
#[doc(alias = "[]")]
|
||||||
#[const_trait]
|
#[const_trait]
|
||||||
pub trait IndexMut<Idx: ?Sized>: Index<Idx> {
|
pub trait IndexMut<Idx: ?Sized>: ~const Index<Idx> {
|
||||||
/// Performs the mutable indexing (`container[index]`) operation.
|
/// Performs the mutable indexing (`container[index]`) operation.
|
||||||
///
|
///
|
||||||
/// # Panics
|
/// # Panics
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue