Skip to content

Commit a0824fc

Browse files
estebankpietroalbini
authored andcommitted
Simplify logic
1 parent 52b540f commit a0824fc

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/librustc/ty/context.rs

+2-8
Original file line numberDiff line numberDiff line change
@@ -1609,16 +1609,10 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
16091609
match self.hir.get(node_id) {
16101610
Node::Item(item) => {
16111611
match item.node {
1612-
ItemKind::Trait(..)
1613-
| ItemKind::TraitAlias(..)
1614-
| ItemKind::Mod(..)
1615-
| ItemKind::ForeignMod(..)
1616-
| ItemKind::GlobalAsm(..)
1617-
| ItemKind::ExternCrate(..)
1618-
| ItemKind::Use(..) => {
1612+
ItemKind::Fn(..) => { /* type_of_def_id() will work */ }
1613+
_ => {
16191614
return None;
16201615
}
1621-
_ => { /* type_of_def_id() will work */ }
16221616
}
16231617
}
16241618
_ => { /* type_of_def_id() will work or panic */ }

0 commit comments

Comments
 (0)