File tree 1 file changed +6
-0
lines changed
1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -1730,6 +1730,12 @@ impl Clean<Variant> for hir::VariantData<'_> {
1730
1730
fn clean ( & self , cx : & mut DocContext < ' _ > ) -> Variant {
1731
1731
match self {
1732
1732
hir:: VariantData :: Struct ( ..) => Variant :: Struct ( self . clean ( cx) ) ,
1733
+ // Important note here: `Variant::Tuple` is used on tuple structs which are not in an
1734
+ // enum (so where converting from `ty::VariantDef`). In case we are in an enum, the kind
1735
+ // is provided by the `Variant` wrapper directly, and since we need the fields' name
1736
+ // (even for a tuple struct variant!), it's simpler to just store it as a
1737
+ // `Variant::Struct` instead of a `Variant::Tuple` (otherwise it would force us to make
1738
+ // a lot of changes when rendering them to generate the name as well).
1733
1739
hir:: VariantData :: Tuple ( ..) => Variant :: Struct ( self . clean ( cx) ) ,
1734
1740
hir:: VariantData :: Unit ( ..) => Variant :: CLike ,
1735
1741
}
You can’t perform that action at this time.
0 commit comments