From 9370ae1abf316ed4174abe21cf4ea93f8dec55aa Mon Sep 17 00:00:00 2001 From: Eduard Burtescu Date: Tue, 23 Dec 2014 21:33:57 +0200 Subject: [PATCH] rustc_typeck: fix fallout of merging ast::ViewItem into ast::Item. --- src/librustc_typeck/collect.rs | 2 ++ src/librustc_typeck/variance.rs | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/src/librustc_typeck/collect.rs b/src/librustc_typeck/collect.rs index 80c0a72db838..329f86293774 100644 --- a/src/librustc_typeck/collect.rs +++ b/src/librustc_typeck/collect.rs @@ -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!(), } diff --git a/src/librustc_typeck/variance.rs b/src/librustc_typeck/variance.rs index 86447e76a898..941f50c298ef 100644 --- a/src/librustc_typeck/variance.rs +++ b/src/librustc_typeck/variance.rs @@ -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(..) |