]> git.proxmox.com Git - rustc.git/blobdiff - compiler/rustc_middle/src/ty/generics.rs
New upstream version 1.60.0+dfsg1
[rustc.git] / compiler / rustc_middle / src / ty / generics.rs
index 1c3a01e2cfadf99aa1017fe3a38bf5696b908a3a..0bd96f8f865fcaa33f4882a1c1f5535802300765 100644 (file)
@@ -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)]