about summary refs log tree commit diff
path: root/compiler/rustc_hir/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_hir/src
parentb3d71d900186c3fab2a91d84efcccc739df191d5 (diff)
reviews ish
Diffstat (limited to 'compiler/rustc_hir/src')
-rw-r--r--compiler/rustc_hir/src/hir.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/compiler/rustc_hir/src/hir.rs b/compiler/rustc_hir/src/hir.rs
index 7a348a2c94a..76f4df6ec2d 100644
--- a/compiler/rustc_hir/src/hir.rs
+++ b/compiler/rustc_hir/src/hir.rs
@@ -314,6 +314,13 @@ impl GenericArg<'_> {
             GenericArg::Infer(_) => ast::ParamKindOrd::Infer,
         }
     }
+
+    pub fn is_ty_or_const(&self) -> bool {
+        match self {
+            GenericArg::Lifetime(_) => false,
+            GenericArg::Type(_) | GenericArg::Const(_) | GenericArg::Infer(_) => true,
+        }
+    }
 }
 
 #[derive(Debug, HashStable_Generic)]