diff options
| author | Ellen <supbscripter@gmail.com> | 2022-01-14 13:44:52 +0000 |
|---|---|---|
| committer | Ellen <supbscripter@gmail.com> | 2022-01-14 13:45:07 +0000 |
| commit | 61c07a9a23d8967564bdddb5137efadeb48df271 (patch) | |
| tree | 8f14f55fca65df5cc14e97c8f3b98c4ec5e751ba /compiler/rustc_middle/src | |
| parent | b3d71d900186c3fab2a91d84efcccc739df191d5 (diff) | |
| download | rust-61c07a9a23d8967564bdddb5137efadeb48df271.tar.gz rust-61c07a9a23d8967564bdddb5137efadeb48df271.zip | |
reviews ish
Diffstat (limited to 'compiler/rustc_middle/src')
| -rw-r--r-- | compiler/rustc_middle/src/ty/generics.rs | 7 |
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)] |
