diff options
| author | Manish Goregaokar <manishsmail@gmail.com> | 2016-10-04 15:24:04 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-10-04 15:24:04 +0530 |
| commit | 177aabdfe3c47412d8d29d9d726640a5134a6b7d (patch) | |
| tree | 3d8a282aad6f77186b901d8ab1cc8dc0f3d938fd | |
| parent | 0e3cd4ed1587bfae58c39c10ced9bdcf6ee763af (diff) | |
| parent | 78579034ec7de62d70b4c0d5796aaabb5cb13ceb (diff) | |
| download | rust-177aabdfe3c47412d8d29d9d726640a5134a6b7d.tar.gz rust-177aabdfe3c47412d8d29d9d726640a5134a6b7d.zip | |
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).
| -rw-r--r-- | src/librustc_resolve/build_reduced_graph.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/librustc_resolve/build_reduced_graph.rs b/src/librustc_resolve/build_reduced_graph.rs index 2bf517600b7..0a0d2e4347e 100644 --- a/src/librustc_resolve/build_reduced_graph.rs +++ b/src/librustc_resolve/build_reduced_graph.rs @@ -605,6 +605,10 @@ impl<'a, 'b> Visitor for BuildReducedGraphVisitor<'a, 'b> { let parent = self.resolver.current_module; let def_id = parent.def_id().unwrap(); + if let TraitItemKind::Macro(_) = item.node { + return self.visit_invoc(item.id); + } + // Add the item to the trait info. let item_def_id = self.resolver.definitions.local_def_id(item.id); let mut is_static_method = false; @@ -615,7 +619,7 @@ impl<'a, 'b> Visitor for BuildReducedGraphVisitor<'a, 'b> { (Def::Method(item_def_id), ValueNS) } TraitItemKind::Type(..) => (Def::AssociatedTy(item_def_id), TypeNS), - TraitItemKind::Macro(_) => return self.visit_invoc(item.id), + TraitItemKind::Macro(_) => bug!(), // handled above }; self.resolver.trait_item_map.insert((item.ident.name, def_id), is_static_method); |
