diff options
| author | bors <bors@rust-lang.org> | 2022-01-16 11:19:21 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-01-16 11:19:21 +0000 |
| commit | 7be8693984d32d2f65ce9ded4f65b6b7340bddce (patch) | |
| tree | 5f9cec2bbb5a4332ab6d80c61dbcc2afb8c8eb23 /compiler/rustc_mir_build/src | |
| parent | 42852d7857d2955f19ec333bec1ed107964db200 (diff) | |
| parent | 3f3a10fa64278173718b1fb9ee9ae85b14380af0 (diff) | |
| download | rust-7be8693984d32d2f65ce9ded4f65b6b7340bddce.tar.gz rust-7be8693984d32d2f65ce9ded4f65b6b7340bddce.zip | |
Auto merge of #92805 - BoxyUwU:revert-lazy-anon-const-substs, r=lcnr
partially revertish `lazily "compute" anon const default substs` reverts #87280 except for some of the changes around `ty::Unevaluated` having a visitor and a generic for promoted why revert: <https://github.com/rust-lang/rust/pull/92805#issuecomment-1010736049> r? `@lcnr`
Diffstat (limited to 'compiler/rustc_mir_build/src')
| -rw-r--r-- | compiler/rustc_mir_build/src/build/mod.rs | 10 | ||||
| -rw-r--r-- | compiler/rustc_mir_build/src/thir/pattern/const_to_pat.rs | 2 |
2 files changed, 5 insertions, 7 deletions
diff --git a/compiler/rustc_mir_build/src/build/mod.rs b/compiler/rustc_mir_build/src/build/mod.rs index a4f3a63e40b..e2a42de71b9 100644 --- a/compiler/rustc_mir_build/src/build/mod.rs +++ b/compiler/rustc_mir_build/src/build/mod.rs @@ -244,10 +244,10 @@ fn mir_build(tcx: TyCtxt<'_>, def: ty::WithOptConstParam<LocalDefId>) -> Body<'_ // The exception is `body.user_type_annotations`, which is used unmodified // by borrow checking. debug_assert!( - !(body.local_decls.has_free_regions(tcx) - || body.basic_blocks().has_free_regions(tcx) - || body.var_debug_info.has_free_regions(tcx) - || body.yield_ty().has_free_regions(tcx)), + !(body.local_decls.has_free_regions() + || body.basic_blocks().has_free_regions() + || body.var_debug_info.has_free_regions() + || body.yield_ty().has_free_regions()), "Unexpected free regions in MIR: {:?}", body, ); @@ -760,7 +760,6 @@ fn construct_error<'a, 'tcx>( cfg.terminate(START_BLOCK, source_info, TerminatorKind::Unreachable); let mut body = Body::new( - tcx, MirSource::item(def.did.to_def_id()), cfg.basic_blocks, source_scopes, @@ -849,7 +848,6 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { } Body::new( - self.tcx, MirSource::item(self.def_id), self.cfg.basic_blocks, self.source_scopes, diff --git a/compiler/rustc_mir_build/src/thir/pattern/const_to_pat.rs b/compiler/rustc_mir_build/src/thir/pattern/const_to_pat.rs index 8ccf6acf703..d8c9a6fa3fe 100644 --- a/compiler/rustc_mir_build/src/thir/pattern/const_to_pat.rs +++ b/compiler/rustc_mir_build/src/thir/pattern/const_to_pat.rs @@ -238,7 +238,7 @@ impl<'a, 'tcx> ConstToPat<'a, 'tcx> { // code at the moment, because types like `for <'a> fn(&'a ())` do // not *yet* implement `PartialEq`. So for now we leave this here. has_impl - || ty.walk(self.tcx()).any(|t| match t.unpack() { + || ty.walk().any(|t| match t.unpack() { ty::subst::GenericArgKind::Lifetime(_) => false, ty::subst::GenericArgKind::Type(t) => t.is_fn_ptr(), ty::subst::GenericArgKind::Const(_) => false, |
