Skip to content

Commit 177aabd

Browse files
authored
Rollup merge of #36951 - nnethercote:fix-ICE, r=eddyb
Fix an ICE in BuildReducedGraphVisitor::visit_trait_item. This ICE occurs in the futures-rs-test-all benchmark in rustc-benchmarks (fixes #36950).
2 parents 0e3cd4e + 7857903 commit 177aabd

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/librustc_resolve/build_reduced_graph.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -605,6 +605,10 @@ impl<'a, 'b> Visitor for BuildReducedGraphVisitor<'a, 'b> {
605605
let parent = self.resolver.current_module;
606606
let def_id = parent.def_id().unwrap();
607607

608+
if let TraitItemKind::Macro(_) = item.node {
609+
return self.visit_invoc(item.id);
610+
}
611+
608612
// Add the item to the trait info.
609613
let item_def_id = self.resolver.definitions.local_def_id(item.id);
610614
let mut is_static_method = false;
@@ -615,7 +619,7 @@ impl<'a, 'b> Visitor for BuildReducedGraphVisitor<'a, 'b> {
615619
(Def::Method(item_def_id), ValueNS)
616620
}
617621
TraitItemKind::Type(..) => (Def::AssociatedTy(item_def_id), TypeNS),
618-
TraitItemKind::Macro(_) => return self.visit_invoc(item.id),
622+
TraitItemKind::Macro(_) => bug!(), // handled above
619623
};
620624

621625
self.resolver.trait_item_map.insert((item.ident.name, def_id), is_static_method);

0 commit comments

Comments
 (0)