diff --git a/compiler/rustc_hir/src/def.rs b/compiler/rustc_hir/src/def.rs index 917b685958da..ad5d6b1509df 100644 --- a/compiler/rustc_hir/src/def.rs +++ b/compiler/rustc_hir/src/def.rs @@ -134,6 +134,11 @@ pub enum DefKind { }, /// Refers to the struct or enum variant's constructor. /// + /// ``` + /// struct S; + /// let x = S; // S in the value namespace is a Ctor + /// ``` + /// /// The reason `Ctor` exists in addition to [`DefKind::Struct`] and /// [`DefKind::Variant`] is because structs and enum variants exist /// in the *type* namespace, whereas struct and enum variant *constructors*