From 889e5719c642cd6f2592964d244ff6f1d01e65c6 Mon Sep 17 00:00:00 2001 From: bohan Date: Fri, 5 Apr 2024 23:12:43 +0800 Subject: [PATCH] explaining `DefKind::Field` --- compiler/rustc_hir/src/def.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/compiler/rustc_hir/src/def.rs b/compiler/rustc_hir/src/def.rs index e8cecb1930f..2662f5661ba 100644 --- a/compiler/rustc_hir/src/def.rs +++ b/compiler/rustc_hir/src/def.rs @@ -113,6 +113,9 @@ pub enum DefKind { InlineConst, /// Opaque type, aka `impl Trait`. OpaqueTy, + /// A field in a struct, enum or union. e.g. + /// - `bar` in `struct Foo { bar: u8 }` + /// - `Foo::Bar::0` in `enum Foo { Bar(u8) }` Field, /// Lifetime parameter: the `'a` in `struct Foo<'a> { ... }` LifetimeParam,