Struct rustc_pattern_analysis::usefulness::PlaceCtxt
source · pub(crate) struct PlaceCtxt<'a, 'p, Cx: TypeCx> {
pub(crate) mcx: MatchCtxt<'a, 'p, Cx>,
pub(crate) ty: Cx::Ty,
pub(crate) is_scrutinee: bool,
}Expand description
Context that provides information local to a place under investigation.
Fields§
§mcx: MatchCtxt<'a, 'p, Cx>§ty: Cx::TyType of the place under investigation.
is_scrutinee: boolWhether the place is the original scrutinee place, as opposed to a subplace of it.
Implementations§
source§impl<'a, 'p, Cx: TypeCx> PlaceCtxt<'a, 'p, Cx>
impl<'a, 'p, Cx: TypeCx> PlaceCtxt<'a, 'p, Cx>
sourcepub(crate) fn new_dummy(mcx: MatchCtxt<'a, 'p, Cx>, ty: Cx::Ty) -> Self
pub(crate) fn new_dummy(mcx: MatchCtxt<'a, 'p, Cx>, ty: Cx::Ty) -> Self
A PlaceCtxt when code other than is_useful needs one.
pub(crate) fn ctor_arity(&self, ctor: &Constructor<Cx>) -> usize
pub(crate) fn ctor_sub_tys(&self, ctor: &Constructor<Cx>) -> &[Cx::Ty]
pub(crate) fn ctors_for_ty(&self) -> Result<ConstructorSet<Cx>, Cx::Error>
Trait Implementations§
impl<'a, 'p, Cx: TypeCx> Copy for PlaceCtxt<'a, 'p, Cx>
Auto Trait Implementations§
impl<'a, 'p, Cx> !RefUnwindSafe for PlaceCtxt<'a, 'p, Cx>
impl<'a, 'p, Cx> !Send for PlaceCtxt<'a, 'p, Cx>
impl<'a, 'p, Cx> !Sync for PlaceCtxt<'a, 'p, Cx>
impl<'a, 'p, Cx> Unpin for PlaceCtxt<'a, 'p, Cx>
impl<'a, 'p, Cx> !UnwindSafe for PlaceCtxt<'a, 'p, Cx>
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
impl<'a, T> Captures<'a> for Twhere
T: ?Sized,
Layout§
Note: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.