about summary refs log tree commit diff
path: root/compiler/rustc_middle/src
diff options
context:
space:
mode:
authorEllen <supbscripter@gmail.com>2022-01-14 13:44:52 +0000
committerEllen <supbscripter@gmail.com>2022-01-14 13:45:07 +0000
commit61c07a9a23d8967564bdddb5137efadeb48df271 (patch)
tree8f14f55fca65df5cc14e97c8f3b98c4ec5e751ba /compiler/rustc_middle/src
parentb3d71d900186c3fab2a91d84efcccc739df191d5 (diff)
downloadrust-61c07a9a23d8967564bdddb5137efadeb48df271.tar.gz
rust-61c07a9a23d8967564bdddb5137efadeb48df271.zip
reviews ish
Diffstat (limited to 'compiler/rustc_middle/src')
-rw-r--r--compiler/rustc_middle/src/ty/generics.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/compiler/rustc_middle/src/ty/generics.rs b/compiler/rustc_middle/src/ty/generics.rs
index 1c3a01e2cfa..0bd96f8f865 100644
--- a/compiler/rustc_middle/src/ty/generics.rs
+++ b/compiler/rustc_middle/src/ty/generics.rs
@@ -31,6 +31,13 @@ impl GenericParamDefKind {
             GenericParamDefKind::Const { .. } => ast::ParamKindOrd::Const,
         }
     }
+
+    pub fn is_ty_or_const(&self) -> bool {
+        match self {
+            GenericParamDefKind::Lifetime => false,
+            GenericParamDefKind::Type { .. } | GenericParamDefKind::Const { .. } => true,
+        }
+    }
 }
 
 #[derive(Clone, Debug, TyEncodable, TyDecodable, HashStable)]