MIR required_consts, mentioned_items: ensure we do not forget to fill these lists

This commit is contained in:
Ralf Jung 2024-08-01 14:01:17 +02:00
parent 70591dc15d
commit 6d312d7bd1
11 changed files with 113 additions and 44 deletions

View file

@ -888,7 +888,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
body: &'tcx mir::Body<'tcx>,
) -> InterpResult<'tcx> {
// Make sure all the constants required by this frame evaluate successfully (post-monomorphization check).
for &const_ in &body.required_consts {
for &const_ in body.required_consts() {
let c =
self.instantiate_from_current_frame_and_normalize_erasing_regions(const_.const_)?;
c.eval(*self.tcx, self.param_env, const_.span).map_err(|err| {