Skip to content

Commit

Permalink
initial revert
Browse files Browse the repository at this point in the history
  • Loading branch information
BoxyUwU committed Jan 15, 2022
1 parent 409276c commit eef3530
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/constant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit eef3530

Please sign in to comment.