diff --git a/compiler/rustc_mir_build/src/build/matches/simplify.rs b/compiler/rustc_mir_build/src/build/matches/simplify.rs index 705266d4a0bd8..b9332e4d40879 100644 --- a/compiler/rustc_mir_build/src/build/matches/simplify.rs +++ b/compiler/rustc_mir_build/src/build/matches/simplify.rs @@ -252,15 +252,13 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { PatKind::Variant { adt_def, substs, variant_index, ref subpatterns } => { let irrefutable = adt_def.variants.iter_enumerated().all(|(i, v)| { i == variant_index || { - self.hir.tcx().features().exhaustive_patterns - && !v - .uninhabited_from( - self.hir.tcx(), - substs, - adt_def.adt_kind(), - self.hir.param_env, - ) - .is_empty() + !v.uninhabited_from( + self.hir.tcx(), + substs, + adt_def.adt_kind(), + self.hir.param_env, + ) + .is_empty() } }) && (adt_def.did.is_local() || !adt_def.is_variant_list_non_exhaustive()); diff --git a/compiler/rustc_mir_build/src/thir/pattern/deconstruct_pat.rs b/compiler/rustc_mir_build/src/thir/pattern/deconstruct_pat.rs index db2fa5730a338..bbb377a333deb 100644 --- a/compiler/rustc_mir_build/src/thir/pattern/deconstruct_pat.rs +++ b/compiler/rustc_mir_build/src/thir/pattern/deconstruct_pat.rs @@ -922,12 +922,12 @@ impl<'tcx> SplitWildcard<'tcx> { // exception is if the pattern is at the top level, because we want empty matches to be // considered exhaustive. let is_secretly_empty = def.variants.is_empty() - && !cx.tcx.features().exhaustive_patterns + && !true && !pcx.is_top_level; if is_secretly_empty || is_declared_nonexhaustive { smallvec![NonExhaustive] - } else if cx.tcx.features().exhaustive_patterns { + } else if true { // If `exhaustive_patterns` is enabled, we exclude variants known to be // uninhabited. def.variants @@ -972,7 +972,7 @@ impl<'tcx> SplitWildcard<'tcx> { // If `exhaustive_patterns` is disabled and our scrutinee is the never type, we cannot // expose its emptiness. The exception is if the pattern is at the top level, because we // want empty matches to be considered exhaustive. - ty::Never if !cx.tcx.features().exhaustive_patterns && !pcx.is_top_level => { + ty::Never if !true && !pcx.is_top_level => { smallvec![NonExhaustive] } ty::Never => smallvec![], diff --git a/compiler/rustc_mir_build/src/thir/pattern/usefulness.rs b/compiler/rustc_mir_build/src/thir/pattern/usefulness.rs index 83fee380ccce7..56bdb965018b6 100644 --- a/compiler/rustc_mir_build/src/thir/pattern/usefulness.rs +++ b/compiler/rustc_mir_build/src/thir/pattern/usefulness.rs @@ -314,11 +314,7 @@ crate struct MatchCheckCtxt<'a, 'tcx> { impl<'a, 'tcx> MatchCheckCtxt<'a, 'tcx> { pub(super) fn is_uninhabited(&self, ty: Ty<'tcx>) -> bool { - if self.tcx.features().exhaustive_patterns { - self.tcx.is_ty_uninhabited_from(self.module, ty, self.param_env) - } else { - false - } + self.tcx.is_ty_uninhabited_from(self.module, ty, self.param_env) } /// Returns whether the given type is an enum from another crate declared `#[non_exhaustive]`. diff --git a/compiler/rustc_traits/src/chalk/lowering.rs b/compiler/rustc_traits/src/chalk/lowering.rs index 8aa68e533a2e1..638a640a3e9a7 100644 --- a/compiler/rustc_traits/src/chalk/lowering.rs +++ b/compiler/rustc_traits/src/chalk/lowering.rs @@ -485,6 +485,7 @@ impl<'tcx> LowerInto<'tcx, Region<'tcx>> for &chalk_ir::Lifetime ty::RegionKind::ReStatic, + #[cfg(bootstrap)] chalk_ir::LifetimeData::Phantom(_, _) => unimplemented!(), }; interner.tcx.mk_region(kind)