Enum rustc_hir::ConstContext [−][src]
pub enum ConstContext {
ConstFn,
Static(Mutability),
Const,
}Expand description
The kind of an item that requires const-checking.
Variants
Expand description
A const fn.
Static(Mutability)Expand description
A static or static mut.
Expand description
A const, associated const, or other const context.
Other contexts include:
- Array length expressions
- Enum discriminants
- Const generics
For the most part, other contexts are treated just like a regular const, so they are
lumped into the same category.
Implementations
impl ConstContext[src]
impl ConstContext[src]pub fn keyword_name(self) -> &'static str[src]
pub fn keyword_name(self) -> &'static str[src]A description of this const context that can appear between backticks in an error message.
E.g. const or static mut.
Trait Implementations
impl Clone for ConstContext[src]
impl Clone for ConstContext[src]fn clone(&self) -> ConstContext[src]
fn clone(&self) -> ConstContext[src]Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)1.0.0[src]Performs copy-assignment from source. Read more
impl Debug for ConstContext[src]
impl Debug for ConstContext[src]impl Display for ConstContext[src]
impl Display for ConstContext[src]A colloquial, trivially pluralizable description of this const context for use in error messages.
impl PartialEq<ConstContext> for ConstContext[src]
impl PartialEq<ConstContext> for ConstContext[src]fn eq(&self, other: &ConstContext) -> bool[src]
fn eq(&self, other: &ConstContext) -> bool[src]This method tests for self and other values to be equal, and is used
by ==. Read more
fn ne(&self, other: &ConstContext) -> bool[src]
fn ne(&self, other: &ConstContext) -> bool[src]This method tests for !=.
impl Copy for ConstContext[src]
impl Eq for ConstContext[src]
impl StructuralEq for ConstContext[src]
impl StructuralPartialEq for ConstContext[src]
Auto Trait Implementations
impl RefUnwindSafe for ConstContext
impl Send for ConstContext
impl Sync for ConstContext
impl Unpin for ConstContext
impl UnwindSafe for ConstContext
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]pub fn borrow_mut(&mut self) -> &mut T[src]
pub fn borrow_mut(&mut self) -> &mut T[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone, [src]
impl<T> ToOwned for T where
T: Clone, [src]type Owned = T
type Owned = TThe resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn to_owned(&self) -> T[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)[src]
pub fn clone_into(&self, target: &mut T)[src]🔬 This is a nightly-only experimental API. (toowned_clone_into)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more