diff options
| author | lcnr <rust@lcnr.de> | 2021-03-16 00:05:45 +0100 |
|---|---|---|
| committer | lcnr <rust@lcnr.de> | 2021-08-26 11:00:30 +0200 |
| commit | bfaf13af4e5071b09248979e51c6614bf1353f52 (patch) | |
| tree | 930c166e6495f44e0c5e1adb9d962c094d7c1b41 /compiler/rustc_mir_build/src | |
| parent | f4b606fd1703fb54bf75f064482312a67beb4a7b (diff) | |
| download | rust-bfaf13af4e5071b09248979e51c6614bf1353f52.tar.gz rust-bfaf13af4e5071b09248979e51c6614bf1353f52.zip | |
make unevaluated const substs optional
Diffstat (limited to 'compiler/rustc_mir_build/src')
| -rw-r--r-- | compiler/rustc_mir_build/src/thir/cx/expr.rs | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/compiler/rustc_mir_build/src/thir/cx/expr.rs b/compiler/rustc_mir_build/src/thir/cx/expr.rs index f1d882e1ddd..9106f1d2342 100644 --- a/compiler/rustc_mir_build/src/thir/cx/expr.rs +++ b/compiler/rustc_mir_build/src/thir/cx/expr.rs @@ -693,11 +693,10 @@ 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 { - def: ty::WithOptConstParam::unknown(did), + val: ty::ConstKind::Unevaluated(ty::Unevaluated::new( + ty::WithOptConstParam::unknown(did), substs, - promoted: None, - }), + )), ty: var_ty, }; let lhs = self.thir.exprs.push(mk_const(self.tcx().mk_const(lhs))); @@ -889,11 +888,10 @@ 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 { - def: ty::WithOptConstParam::unknown(def_id), + val: ty::ConstKind::Unevaluated(ty::Unevaluated::new( + ty::WithOptConstParam::unknown(def_id), substs, - promoted: None, - }), + )), ty: self.typeck_results().node_type(expr.hir_id), }), user_ty, |
