MIR required_consts, mentioned_items: ensure we do not forget to fill these lists
This commit is contained in:
parent
70591dc15d
commit
6d312d7bd1
11 changed files with 113 additions and 44 deletions
|
@ -1229,7 +1229,7 @@ fn collect_items_of_instance<'tcx>(
|
|||
|
||||
// Always visit all `required_consts`, so that we evaluate them and abort compilation if any of
|
||||
// them errors.
|
||||
for const_op in &body.required_consts {
|
||||
for const_op in body.required_consts() {
|
||||
if let Some(val) = collector.eval_constant(const_op) {
|
||||
collect_const_value(tcx, val, mentioned_items);
|
||||
}
|
||||
|
@ -1237,7 +1237,7 @@ fn collect_items_of_instance<'tcx>(
|
|||
|
||||
// Always gather mentioned items. We try to avoid processing items that we have already added to
|
||||
// `used_items` above.
|
||||
for item in &body.mentioned_items {
|
||||
for item in body.mentioned_items() {
|
||||
if !collector.used_mentioned_items.contains(&item.node) {
|
||||
let item_mono = collector.monomorphize(item.node);
|
||||
visit_mentioned_item(tcx, &item_mono, item.span, mentioned_items);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue