about summary refs log tree commit diff
path: root/compiler/rustc_hir/src/def.rs
diff options
context:
space:
mode:
authorbohan <bohan-zhang@foxmail.com>2024-04-05 23:12:43 +0800
committerbohan <bohan-zhang@foxmail.com>2024-04-05 23:12:43 +0800
commit889e5719c642cd6f2592964d244ff6f1d01e65c6 (patch)
treef1f31823671ee4292ea609b97413aef6113d00cf /compiler/rustc_hir/src/def.rs
parent4563f70c3b599411836e285591479f4a3d364708 (diff)
downloadrust-889e5719c642cd6f2592964d244ff6f1d01e65c6.tar.gz
rust-889e5719c642cd6f2592964d244ff6f1d01e65c6.zip
explaining `DefKind::Field`
Diffstat (limited to 'compiler/rustc_hir/src/def.rs')
-rw-r--r--compiler/rustc_hir/src/def.rs3
1 files changed, 3 insertions, 0 deletions
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,