diff options
| author | lcnr <rust@lcnr.de> | 2021-03-13 16:31:38 +0100 |
|---|---|---|
| committer | lcnr <rust@lcnr.de> | 2021-03-20 17:22:24 +0100 |
| commit | 500bcfcdb3122d68cabdfc2eb9034d88b708e0bc (patch) | |
| tree | ddbc5dd75de5544a1a6fded261e5705e8c74d938 | |
| parent | e4a1092b9f21a7dd966d7198846132f3dd17513a (diff) | |
| download | rust-500bcfcdb3122d68cabdfc2eb9034d88b708e0bc.tar.gz rust-500bcfcdb3122d68cabdfc2eb9034d88b708e0bc.zip | |
update `const_eval_resolve`
| -rw-r--r-- | src/constant.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/constant.rs b/src/constant.rs index 9d93370b7d0..f4cbfb6967f 100644 --- a/src/constant.rs +++ b/src/constant.rs @@ -45,9 +45,9 @@ pub(crate) fn check_constants(fx: &mut FunctionCx<'_, '_, '_>) -> bool { }; match const_.val { ConstKind::Value(_) => {} - ConstKind::Unevaluated(def, ref substs, promoted) => { + ConstKind::Unevaluated(unevaluated) => { if let Err(err) = - fx.tcx.const_eval_resolve(ParamEnv::reveal_all(), def, substs, promoted, None) + fx.tcx.const_eval_resolve(ParamEnv::reveal_all(), unevaluated, None) { all_constants_ok = false; match err { @@ -122,14 +122,14 @@ pub(crate) fn codegen_constant<'tcx>( }; let const_val = match const_.val { ConstKind::Value(const_val) => const_val, - ConstKind::Unevaluated(def, ref substs, promoted) if fx.tcx.is_static(def.did) => { + ConstKind::Unevaluated(ty::Unevaluated { def, substs, promoted }) if fx.tcx.is_static(def.did) => { assert!(substs.is_empty()); assert!(promoted.is_none()); return codegen_static_ref(fx, def.did, fx.layout_of(const_.ty)).to_cvalue(fx); } - ConstKind::Unevaluated(def, ref substs, promoted) => { - match fx.tcx.const_eval_resolve(ParamEnv::reveal_all(), def, substs, promoted, None) { + ConstKind::Unevaluated(unevaluated) => { + match fx.tcx.const_eval_resolve(ParamEnv::reveal_all(), unevaluated, None) { Ok(const_val) => const_val, Err(_) => { span_bug!(constant.span, "erroneous constant not captured by required_consts"); |
