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: DefIdExpand description
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]
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]
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,
'tcx: 'a,
impl<'a, 'tcx> !UnwindSafe for MatchCheckCtxt<'a, 'tcx>
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]pub fn borrow_mut(&mut self) -> &mut T[src]
pub fn borrow_mut(&mut self) -> &mut T[src]Mutably borrows from an owned value. Read more
impl<'a, T> Captures<'a> for T where
T: ?Sized, [src]
T: ?Sized,