Expand _ into explicit variants in match

This commit is contained in:
A.J. Gardner 2017-03-16 22:16:40 -05:00
parent 768e902941
commit 6bcd5b0980

View File

@ -490,8 +490,10 @@ fn convert_item<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, item_id: ast::NodeId) {
let def_id = tcx.hir.local_def_id(item_id); let def_id = tcx.hir.local_def_id(item_id);
match it.node { match it.node {
// These don't define types. // These don't define types.
hir::ItemExternCrate(_) | hir::ItemUse(..) | hir::ItemMod(_) => { hir::ItemExternCrate(_) |
} hir::ItemUse(..) |
hir::ItemMod(_) |
hir::ItemGlobalAsm(_) => {}
hir::ItemForeignMod(ref foreign_mod) => { hir::ItemForeignMod(ref foreign_mod) => {
for item in &foreign_mod.items { for item in &foreign_mod.items {
let def_id = tcx.hir.local_def_id(item.id); let def_id = tcx.hir.local_def_id(item.id);
@ -543,12 +545,12 @@ fn convert_item<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, item_id: ast::NodeId) {
tcx.item_generics(def_id); tcx.item_generics(def_id);
tcx.item_type(def_id); tcx.item_type(def_id);
tcx.item_predicates(def_id); tcx.item_predicates(def_id);
}, }
_ => { hir::ItemStatic(..) | hir::ItemConst(..) | hir::ItemFn(..) => {
tcx.item_generics(def_id); tcx.item_generics(def_id);
tcx.item_type(def_id); tcx.item_type(def_id);
tcx.item_predicates(def_id); tcx.item_predicates(def_id);
}, }
} }
} }