Expand description
Not represented directly in the AST; referred to by name through a ty_path.
Variants
Int(IntTy)
Uint(UintTy)
Float(FloatTy)
Str
Bool
Char
Implementations
sourceimpl PrimTy
impl PrimTy
sourcepub const ALL: [Self; 17] = [
// any changes here should also be reflected in `PrimTy::from_name`
Self::Int(IntTy::I8),
Self::Int(IntTy::I16),
Self::Int(IntTy::I32),
Self::Int(IntTy::I64),
Self::Int(IntTy::I128),
Self::Int(IntTy::Isize),
Self::Uint(UintTy::U8),
Self::Uint(UintTy::U16),
Self::Uint(UintTy::U32),
Self::Uint(UintTy::U64),
Self::Uint(UintTy::U128),
Self::Uint(UintTy::Usize),
Self::Float(FloatTy::F32),
Self::Float(FloatTy::F64),
Self::Bool,
Self::Char,
Self::Str,
]
pub const ALL: [Self; 17] = [ // any changes here should also be reflected in `PrimTy::from_name` Self::Int(IntTy::I8), Self::Int(IntTy::I16), Self::Int(IntTy::I32), Self::Int(IntTy::I64), Self::Int(IntTy::I128), Self::Int(IntTy::Isize), Self::Uint(UintTy::U8), Self::Uint(UintTy::U16), Self::Uint(UintTy::U32), Self::Uint(UintTy::U64), Self::Uint(UintTy::U128), Self::Uint(UintTy::Usize), Self::Float(FloatTy::F32), Self::Float(FloatTy::F64), Self::Bool, Self::Char, Self::Str, ]
All of the primitive types
sourcepub fn name_str(self) -> &'static str
pub fn name_str(self) -> &'static str
Like PrimTy::name, but returns a &str instead of a symbol.
Used by clippy.
pub fn name(self) -> Symbol
Trait Implementations
sourceimpl<__CTX> HashStable<__CTX> for PrimTy where
__CTX: HashStableContext,
impl<__CTX> HashStable<__CTX> for PrimTy where
__CTX: HashStableContext,
fn hash_stable(&self, __hcx: &mut __CTX, __hasher: &mut StableHasher)
impl Copy for PrimTy
impl Eq for PrimTy
impl StructuralEq for PrimTy
impl StructuralPartialEq for PrimTy
Auto Trait Implementations
impl RefUnwindSafe for PrimTy
impl Send for PrimTy
impl Sync for PrimTy
impl Unpin for PrimTy
impl UnwindSafe for PrimTy
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Layout
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference’s “Type Layout” chapter for details on type layout guarantees.
Size: 2 bytes
Size for each variant:
Int: 1 byteUint: 1 byteFloat: 1 byteStr: 0 bytesBool: 0 bytesChar: 0 bytes