Skip to content

Commit 7a5cd9e

Browse files
committed
rustc_typeck: fix fallout of merging ast::ViewItem into ast::Item.
1 parent cbc18ff commit 7a5cd9e

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
@@ -540,6 +540,7 @@ pub fn convert(ccx: &CrateCtxt, it: &ast::Item) {
540540
debug!("convert: item {} with id {}", token::get_ident(it.ident), it.id);
541541
match it.node {
542542
// These don't define types.
543+
ast::ItemExternCrate(_) | ast::ItemUse(_) |
543544
ast::ItemForeignMod(_) | ast::ItemMod(_) | ast::ItemMac(_) => {}
544545
ast::ItemEnum(ref enum_definition, ref generics) => {
545546
let scheme = ty_of_item(ccx, it);
@@ -979,6 +980,7 @@ pub fn ty_of_item<'a, 'tcx>(ccx: &CrateCtxt<'a, 'tcx>, it: &ast::Item)
979980
tcx.tcache.borrow_mut().insert(local_def(it.id), scheme.clone());
980981
return scheme;
981982
}
983+
ast::ItemExternCrate(_) | ast::ItemUse(_) |
982984
ast::ItemImpl(..) | ast::ItemMod(_) |
983985
ast::ItemForeignMod(_) | ast::ItemMac(_) => panic!(),
984986
}

src/librustc_typeck/variance.rs

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

382+
ast::ItemExternCrate(_) |
383+
ast::ItemUse(_) |
382384
ast::ItemImpl(..) |
383385
ast::ItemStatic(..) |
384386
ast::ItemConst(..) |
@@ -531,6 +533,8 @@ impl<'a, 'tcx, 'v> Visitor<'v> for ConstraintContext<'a, 'tcx> {
531533
}
532534
}
533535

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

0 commit comments

Comments
 (0)