Struct rustc_mir_build::thir::pattern::usefulness::MatchCheckCtxt[][src]

pub(crate) struct MatchCheckCtxt<'a, 'tcx> {
    pub(crate) tcx: TyCtxt<'tcx>,
    pub(crate) module: DefId,
    pub(crate) param_env: ParamEnv<'tcx>,
    pub(crate) pattern_arena: &'a TypedArena<Pat<'tcx>>,
}

Fields

tcx: TyCtxt<'tcx>module: DefId

The module in which the match occurs. This is necessary for checking inhabited-ness of types because whether a type is (visibly) inhabited can depend on whether it was defined in the current module or not. E.g., struct Foo { _private: ! } cannot be seen to be empty outside its module and should not be matchable with an empty match statement.

param_env: ParamEnv<'tcx>pattern_arena: &'a TypedArena<Pat<'tcx>>

Implementations

impl<'a, 'tcx> MatchCheckCtxt<'a, 'tcx>[src]

pub(super) fn is_uninhabited(&self, ty: Ty<'tcx>) -> bool[src]

pub(super) fn is_foreign_non_exhaustive_enum(&self, ty: Ty<'tcx>) -> bool[src]

Returns whether the given type is an enum from another crate declared #[non_exhaustive].

Auto Trait Implementations

impl<'a, 'tcx> !RefUnwindSafe for MatchCheckCtxt<'a, 'tcx>

impl<'a, 'tcx> !Send for MatchCheckCtxt<'a, 'tcx>

impl<'a, 'tcx> !Sync for MatchCheckCtxt<'a, 'tcx>

impl<'a, 'tcx> Unpin for MatchCheckCtxt<'a, 'tcx> where
    'tcx: 'a, 

impl<'a, 'tcx> !UnwindSafe for MatchCheckCtxt<'a, 'tcx>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<'a, T> Captures<'a> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.