Skip to content

Commit a10dd1f

Browse files
committed
address review again
1 parent fa35afe commit a10dd1f

File tree

1 file changed

+1
-19
lines changed

1 file changed

+1
-19
lines changed

src/constant.rs

+1-19
Original file line numberDiff line numberDiff line change
@@ -121,25 +121,7 @@ pub(crate) fn codegen_constant<'tcx>(
121121
ConstKind::Value(valtree) => {
122122
(fx.tcx.valtree_to_const_val((const_.ty(), valtree)), const_.ty())
123123
}
124-
ConstKind::Unevaluated(ty::Unevaluated { def, substs, promoted })
125-
if fx.tcx.is_static(def.did) =>
126-
{
127-
assert!(substs.is_empty());
128-
assert_eq!(promoted, ());
129-
return codegen_static_ref(fx, def.did, fx.layout_of(const_.ty())).to_cvalue(fx);
130-
}
131-
ConstKind::Unevaluated(unevaluated) => {
132-
match fx.tcx.const_eval_resolve(ParamEnv::reveal_all(), unevaluated.expand(), None)
133-
{
134-
Ok(const_val) => (const_val, const_.ty()),
135-
Err(_) => {
136-
span_bug!(
137-
constant.span,
138-
"erroneous constant not captured by required_consts"
139-
);
140-
}
141-
}
142-
}
124+
ConstKind::Unevaluated(_) => bug!("expected constant to be evaluated at this stage"),
143125
ConstKind::Param(_)
144126
| ConstKind::Infer(_)
145127
| ConstKind::Bound(_, _)

0 commit comments

Comments
 (0)