pub enum PathElem {
Field(Symbol),
Variant(Symbol),
GeneratorState(VariantIdx),
CapturedVar(Symbol),
ArrayElem(usize),
TupleElem(usize),
Deref,
EnumTag,
GeneratorTag,
DynDowncast,
}
Expand description
We want to show a nice path to the invalid field for diagnostics,
but avoid string operations in the happy case where no error happens.
So we track a Vec<PathElem>
where PathElem
contains all the data we
need to later print something for the user.
Variants
Field(Symbol)
Variant(Symbol)
GeneratorState(VariantIdx)
CapturedVar(Symbol)
ArrayElem(usize)
TupleElem(usize)
Deref
EnumTag
GeneratorTag
DynDowncast
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for PathElem
impl Send for PathElem
impl Sync for PathElem
impl Unpin for PathElem
impl UnwindSafe for PathElem
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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: 16 bytes
Size for each variant:
Field
: 4 bytesVariant
: 4 bytesGeneratorState
: 4 bytesCapturedVar
: 4 bytesArrayElem
: 12 bytesTupleElem
: 12 bytesDeref
: 0 bytesEnumTag
: 0 bytesGeneratorTag
: 0 bytesDynDowncast
: 0 bytes