1
Fork 0

Rollup merge of #128494 - RalfJung:mir-lazy-lists, r=compiler-errors

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

Bodies initially get created with empty required_consts and mentioned_items, but at some point those should be filled. Make sure we notice when that is forgotten.
This commit is contained in:
Matthias Krüger 2024-08-02 06:43:44 +02:00 committed by GitHub
commit 66d243f61b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 113 additions and 44 deletions

View file

@ -877,7 +877,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| {