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 | eef35308efcd493587d9b1d23b2363d99246a220 (patch) | |
| tree | 55a249c53194f5715979b366abfff40c56dd4a98 | |
| parent | 409276cf55a666932524d9d9dd9e0a0329364db3 (diff) | |
| download | rust-eef35308efcd493587d9b1d23b2363d99246a220.tar.gz rust-eef35308efcd493587d9b1d23b2363d99246a220.zip | |
initial revert
| -rw-r--r-- | src/constant.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/constant.rs b/src/constant.rs index 9a6c45ae98d..0c06c77472b 100644 --- a/src/constant.rs +++ b/src/constant.rs @@ -129,11 +129,13 @@ pub(crate) fn codegen_constant<'tcx>( }; let const_val = match const_.val { ConstKind::Value(const_val) => const_val, - ConstKind::Unevaluated(uv) if fx.tcx.is_static(uv.def.did) => { - assert!(uv.substs(fx.tcx).is_empty()); - assert!(uv.promoted.is_none()); + 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, uv.def.did, fx.layout_of(const_.ty)).to_cvalue(fx); + return codegen_static_ref(fx, def.did, fx.layout_of(const_.ty)).to_cvalue(fx); } ConstKind::Unevaluated(unevaluated) => { match fx.tcx.const_eval_resolve(ParamEnv::reveal_all(), unevaluated, None) { |
