diff options
| author | Ellen <supbscripter@gmail.com> | 2022-01-12 03:19:52 +0000 |
|---|---|---|
| committer | Ellen <supbscripter@gmail.com> | 2022-01-15 01:16:55 +0000 |
| commit | 71bbb603f4108bc1f0bc8c8395ec725bb66e7802 (patch) | |
| tree | 668ba88d044cebf908cedfcd9a3479f401fa86f3 /compiler/rustc_mir_build | |
| parent | b0ec3e09a996f2cb35be7710fd1003c3c38f1667 (diff) | |
| download | rust-71bbb603f4108bc1f0bc8c8395ec725bb66e7802.tar.gz rust-71bbb603f4108bc1f0bc8c8395ec725bb66e7802.zip | |
initial revert
Diffstat (limited to 'compiler/rustc_mir_build')
| -rw-r--r-- | compiler/rustc_mir_build/src/build/mod.rs | 10 | ||||
| -rw-r--r-- | compiler/rustc_mir_build/src/thir/cx/expr.rs | 14 | ||||
| -rw-r--r-- | compiler/rustc_mir_build/src/thir/pattern/const_to_pat.rs | 2 |
3 files changed, 13 insertions, 13 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/cx/expr.rs b/compiler/rustc_mir_build/src/thir/cx/expr.rs index c62de154388..e090ecf2114 100644 --- a/compiler/rustc_mir_build/src/thir/cx/expr.rs +++ b/compiler/rustc_mir_build/src/thir/cx/expr.rs @@ -716,10 +716,11 @@ impl<'tcx> Cx<'tcx> { // and not the beginning of discriminants (which is always `0`) let substs = InternalSubsts::identity_for_item(self.tcx(), did); let lhs = ty::Const { - val: ty::ConstKind::Unevaluated(ty::Unevaluated::new( - ty::WithOptConstParam::unknown(did), + val: ty::ConstKind::Unevaluated(ty::Unevaluated { + def: ty::WithOptConstParam::unknown(did), substs, - )), + promoted: None, + }), ty: var_ty, }; let lhs = self.thir.exprs.push(mk_const(self.tcx().mk_const(lhs))); @@ -911,10 +912,11 @@ impl<'tcx> Cx<'tcx> { debug!("convert_path_expr: (const) user_ty={:?}", user_ty); ExprKind::Literal { literal: self.tcx.mk_const(ty::Const { - val: ty::ConstKind::Unevaluated(ty::Unevaluated::new( - ty::WithOptConstParam::unknown(def_id), + val: ty::ConstKind::Unevaluated(ty::Unevaluated { + def: ty::WithOptConstParam::unknown(def_id), substs, - )), + promoted: None, + }), ty: self.typeck_results().node_type(expr.hir_id), }), user_ty, 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 dd16e3cde75..50512139f5d 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 @@ -240,7 +240,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, |
