Skip to content

Commit

Permalink
rustc_typeck: fix fallout of merging ast::ViewItem into ast::Item.
Browse files Browse the repository at this point in the history
  • Loading branch information
eddyb committed Jan 21, 2015
1 parent cfb63d5 commit 9370ae1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/librustc_typeck/collect.rs
Expand Up @@ -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);
Expand Down Expand Up @@ -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!(),
}
Expand Down
4 changes: 4 additions & 0 deletions src/librustc_typeck/variance.rs
Expand Up @@ -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(..) |
Expand Down Expand Up @@ -532,6 +534,8 @@ impl<'a, 'tcx, 'v> Visitor<'v> for ConstraintContext<'a, 'tcx> {
}
}

ast::ItemExternCrate(_) |
ast::ItemUse(_) |
ast::ItemStatic(..) |
ast::ItemConst(..) |
ast::ItemFn(..) |
Expand Down

0 comments on commit 9370ae1

Please sign in to comment.