diff options
| author | Cameron Steffen <cam.steffen94@gmail.com> | 2025-07-24 18:34:17 -0500 |
|---|---|---|
| committer | Cameron Steffen <cam.steffen94@gmail.com> | 2025-07-28 09:53:50 -0500 |
| commit | 0d7abc8df083296c29e0fb816c1c4b10e4cf6577 (patch) | |
| tree | c9f7b45d8ce47205c5ffcdbda7c2c269d6166dfc /compiler/rustc_hir/src/def.rs | |
| parent | 96aca2b442f42684f2deeaf2be560e9548864363 (diff) | |
| download | rust-0d7abc8df083296c29e0fb816c1c4b10e4cf6577.tar.gz rust-0d7abc8df083296c29e0fb816c1c4b10e4cf6577.zip | |
Introduce assoc_parent
Diffstat (limited to 'compiler/rustc_hir/src/def.rs')
| -rw-r--r-- | compiler/rustc_hir/src/def.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/rustc_hir/src/def.rs b/compiler/rustc_hir/src/def.rs index ca57c4f3164..3fee9af01b3 100644 --- a/compiler/rustc_hir/src/def.rs +++ b/compiler/rustc_hir/src/def.rs @@ -295,6 +295,10 @@ impl DefKind { } } + pub fn is_assoc(self) -> bool { + matches!(self, DefKind::AssocConst | DefKind::AssocFn | DefKind::AssocTy) + } + /// This is a "module" in name resolution sense. #[inline] pub fn is_module_like(self) -> bool { |
