rustc_typeck: fix fallout of merging ast::ViewItem into ast::Item.

This commit is contained in:
Eduard Burtescu 2014-12-23 21:33:57 +02:00
parent cfb63d5448
commit 9370ae1abf
2 changed files with 6 additions and 0 deletions

View file

@ -555,6 +555,7 @@ fn convert(ccx: &CollectCtxt, it: &ast::Item) {
debug!("convert: item {} with id {}", token::get_ident(it.ident), it.id);
match it.node {
// These don't define types.
ast::ItemExternCrate(_) | ast::ItemUse(_) |
ast::ItemForeignMod(_) | ast::ItemMod(_) | ast::ItemMac(_) => {}
ast::ItemEnum(ref enum_definition, ref generics) => {
let scheme = ty_of_item(ccx, it);
@ -1004,6 +1005,7 @@ fn ty_of_item<'a, 'tcx>(ccx: &CollectCtxt<'a, 'tcx>, it: &ast::Item)
tcx.tcache.borrow_mut().insert(local_def(it.id), scheme.clone());
return scheme;
}
ast::ItemExternCrate(_) | ast::ItemUse(_) |
ast::ItemImpl(..) | ast::ItemMod(_) |
ast::ItemForeignMod(_) | ast::ItemMac(_) => panic!(),
}

View file

@ -380,6 +380,8 @@ impl<'a, 'tcx, 'v> Visitor<'v> for TermsContext<'a, 'tcx> {
visit::walk_item(self, item);
}
ast::ItemExternCrate(_) |
ast::ItemUse(_) |
ast::ItemImpl(..) |
ast::ItemStatic(..) |
ast::ItemConst(..) |
@ -532,6 +534,8 @@ impl<'a, 'tcx, 'v> Visitor<'v> for ConstraintContext<'a, 'tcx> {
}
}
ast::ItemExternCrate(_) |
ast::ItemUse(_) |
ast::ItemStatic(..) |
ast::ItemConst(..) |
ast::ItemFn(..) |