Struct flowistry_pdg::rustc::mir::UserTypeProjection
source · pub struct UserTypeProjection {
pub base: UserTypeAnnotationIndex,
pub projs: Vec<ProjectionElem<(), ()>, Global>,
}
Expand description
Encodes the effect of a user-supplied type annotation on the
subcomponents of a pattern. The effect is determined by applying the
given list of projections to some underlying base type. Often,
the projection element list projs
is empty, in which case this
directly encodes a type in base
. But in the case of complex patterns with
subpatterns and bindings, we want to apply only a part of the type to a variable,
in which case the projs
vector is used.
Examples:
-
let x: T = ...
– here, theprojs
vector is empty. -
let (x, _): T = ...
– here, theprojs
vector would containfield[0]
(aka.0
), indicating that the type ofs
is determined by finding the type of the.0
field fromT
.
Fields§
§base: UserTypeAnnotationIndex
§projs: Vec<ProjectionElem<(), ()>, Global>
Auto Trait Implementations§
impl RefUnwindSafe for UserTypeProjection
impl Send for UserTypeProjection
impl Sync for UserTypeProjection
impl Unpin for UserTypeProjection
impl UnwindSafe for UserTypeProjection
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more