Skip to content

Commit f35c643

Browse files
committed
rustc_typeck: fix fallout of merging ast::ViewItem into ast::Item.
1 parent 0343b0d commit f35c643

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/librustc_typeck/collect.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -555,6 +555,7 @@ fn convert(ccx: &CollectCtxt, it: &ast::Item) {
555555
debug!("convert: item {} with id {}", token::get_ident(it.ident), it.id);
556556
match it.node {
557557
// These don't define types.
558+
ast::ItemExternCrate(_) | ast::ItemUse(_) |
558559
ast::ItemForeignMod(_) | ast::ItemMod(_) | ast::ItemMac(_) => {}
559560
ast::ItemEnum(ref enum_definition, ref generics) => {
560561
let scheme = ty_of_item(ccx, it);
@@ -1004,6 +1005,7 @@ fn ty_of_item<'a, 'tcx>(ccx: &CollectCtxt<'a, 'tcx>, it: &ast::Item)
10041005
tcx.tcache.borrow_mut().insert(local_def(it.id), scheme.clone());
10051006
return scheme;
10061007
}
1008+
ast::ItemExternCrate(_) | ast::ItemUse(_) |
10071009
ast::ItemImpl(..) | ast::ItemMod(_) |
10081010
ast::ItemForeignMod(_) | ast::ItemMac(_) => panic!(),
10091011
}

src/librustc_typeck/variance.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,8 @@ impl<'a, 'tcx, 'v> Visitor<'v> for TermsContext<'a, 'tcx> {
380380
visit::walk_item(self, item);
381381
}
382382

383+
ast::ItemExternCrate(_) |
384+
ast::ItemUse(_) |
383385
ast::ItemImpl(..) |
384386
ast::ItemStatic(..) |
385387
ast::ItemConst(..) |
@@ -532,6 +534,8 @@ impl<'a, 'tcx, 'v> Visitor<'v> for ConstraintContext<'a, 'tcx> {
532534
}
533535
}
534536

537+
ast::ItemExternCrate(_) |
538+
ast::ItemUse(_) |
535539
ast::ItemStatic(..) |
536540
ast::ItemConst(..) |
537541
ast::ItemFn(..) |

0 commit comments

Comments
 (0)