Skip to content

Commit eef3530

Browse files
committed
initial revert
1 parent 409276c commit eef3530

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/constant.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,13 @@ pub(crate) fn codegen_constant<'tcx>(
129129
};
130130
let const_val = match const_.val {
131131
ConstKind::Value(const_val) => const_val,
132-
ConstKind::Unevaluated(uv) if fx.tcx.is_static(uv.def.did) => {
133-
assert!(uv.substs(fx.tcx).is_empty());
134-
assert!(uv.promoted.is_none());
132+
ConstKind::Unevaluated(ty::Unevaluated { def, substs, promoted })
133+
if fx.tcx.is_static(def.did) =>
134+
{
135+
assert!(substs.is_empty());
136+
assert!(promoted.is_none());
135137

136-
return codegen_static_ref(fx, uv.def.did, fx.layout_of(const_.ty)).to_cvalue(fx);
138+
return codegen_static_ref(fx, def.did, fx.layout_of(const_.ty)).to_cvalue(fx);
137139
}
138140
ConstKind::Unevaluated(unevaluated) => {
139141
match fx.tcx.const_eval_resolve(ParamEnv::reveal_all(), unevaluated, None) {

0 commit comments

Comments
 (0)