about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2018-11-09 10:16:07 -0800
committerEsteban Küber <esteban@kuber.com.ar>2018-11-09 10:16:07 -0800
commita90240d2791b2eaa4ae1401a1b7e280f0da4c524 (patch)
tree2732d4b502369a963e6db623823f319381c16fb1
parent24289a050a8eeb1385f73acb7c1a6de804840d8d (diff)
downloadrust-a90240d2791b2eaa4ae1401a1b7e280f0da4c524.tar.gz
rust-a90240d2791b2eaa4ae1401a1b7e280f0da4c524.zip
Simplify logic
-rw-r--r--src/librustc/ty/context.rs10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/librustc/ty/context.rs b/src/librustc/ty/context.rs
index da0bec80a89..82095a2f5b0 100644
--- a/src/librustc/ty/context.rs
+++ b/src/librustc/ty/context.rs
@@ -1607,16 +1607,10 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
         match self.hir.get(node_id) {
             Node::Item(item) => {
                 match item.node {
-                    ItemKind::Trait(..)
-                    | ItemKind::TraitAlias(..)
-                    | ItemKind::Mod(..)
-                    | ItemKind::ForeignMod(..)
-                    | ItemKind::GlobalAsm(..)
-                    | ItemKind::ExternCrate(..)
-                    | ItemKind::Use(..) => {
+                    ItemKind::Fn(..) => { /* type_of_def_id() will work */ }
+                    _ => {
                         return None;
                     }
-                    _ => { /* type_of_def_id() will work */ }
                 }
             }
             _ => { /* type_of_def_id() will work or panic */ }