Skip to content

Commit 817298a

Browse files
committed
Expand _ into explicit variants in match
1 parent 9e61d5c commit 817298a

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/librustc_typeck/collect.rs

+7-5
Original file line numberDiff line numberDiff line change
@@ -490,8 +490,10 @@ fn convert_item<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, item_id: ast::NodeId) {
490490
let def_id = tcx.hir.local_def_id(item_id);
491491
match it.node {
492492
// These don't define types.
493-
hir::ItemExternCrate(_) | hir::ItemUse(..) | hir::ItemMod(_) => {
494-
}
493+
hir::ItemExternCrate(_) |
494+
hir::ItemUse(..) |
495+
hir::ItemMod(_) |
496+
hir::ItemGlobalAsm(_) => {}
495497
hir::ItemForeignMod(ref foreign_mod) => {
496498
for item in &foreign_mod.items {
497499
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) {
543545
tcx.item_generics(def_id);
544546
tcx.item_type(def_id);
545547
tcx.item_predicates(def_id);
546-
},
547-
_ => {
548+
}
549+
hir::ItemStatic(..) | hir::ItemConst(..) | hir::ItemFn(..) => {
548550
tcx.item_generics(def_id);
549551
tcx.item_type(def_id);
550552
tcx.item_predicates(def_id);
551-
},
553+
}
552554
}
553555
}
554556

0 commit comments

Comments
 (0)