@@ -1287,15 +1287,15 @@ fn item_type_alias(cx: &Context<'_>, it: &clean::Item, t: &clean::TypeAlias) ->
1287
1287
is_non_exhaustive : * is_non_exhaustive,
1288
1288
def_id : enum_def_id,
1289
1289
}
1290
- . render_into ( cx, it, false , w) ?;
1290
+ . render_into ( cx, it, true , w) ?;
1291
1291
}
1292
1292
clean:: TypeAliasInnerType :: Union { fields } => {
1293
- ItemUnion { cx, it, fields, generics : & t. generics , document_union : false }
1293
+ ItemUnion { cx, it, fields, generics : & t. generics , is_type_alias : true }
1294
1294
. render_into ( w) ?;
1295
1295
}
1296
1296
clean:: TypeAliasInnerType :: Struct { ctor_kind, fields } => {
1297
1297
DisplayStruct { ctor_kind : * ctor_kind, generics : & t. generics , fields }
1298
- . render_into ( cx, it, false , w) ?;
1298
+ . render_into ( cx, it, true , w) ?;
1299
1299
}
1300
1300
}
1301
1301
} else {
@@ -1416,7 +1416,7 @@ item_template!(
1416
1416
it: & ' a clean:: Item ,
1417
1417
fields: & ' a [ clean:: Item ] ,
1418
1418
generics: & ' a clean:: Generics ,
1419
- document_union : bool ,
1419
+ is_type_alias : bool ,
1420
1420
} ,
1421
1421
methods = [ document, document_type_layout, render_attributes_in_pre, render_assoc_items]
1422
1422
) ;
@@ -1453,7 +1453,7 @@ impl<'a, 'cx: 'a> ItemUnion<'a, 'cx> {
1453
1453
1454
1454
fn item_union ( cx : & Context < ' _ > , it : & clean:: Item , s : & clean:: Union ) -> impl fmt:: Display {
1455
1455
fmt:: from_fn ( |w| {
1456
- ItemUnion { cx, it, fields : & s. fields , generics : & s. generics , document_union : true }
1456
+ ItemUnion { cx, it, fields : & s. fields , generics : & s. generics , is_type_alias : false }
1457
1457
. render_into ( w)
1458
1458
. unwrap ( ) ;
1459
1459
Ok ( ( ) )
@@ -1494,7 +1494,7 @@ impl<'a> DisplayEnum<'a> {
1494
1494
self ,
1495
1495
cx : & Context < ' _ > ,
1496
1496
it : & clean:: Item ,
1497
- document_enum : bool ,
1497
+ is_type_alias : bool ,
1498
1498
w : & mut W ,
1499
1499
) -> fmt:: Result {
1500
1500
let variants_count = self . variants . iter ( ) . filter ( |i| !i. is_stripped ( ) ) . count ( ) ;
@@ -1521,7 +1521,7 @@ impl<'a> DisplayEnum<'a> {
1521
1521
)
1522
1522
} ) ?;
1523
1523
1524
- if document_enum {
1524
+ if !is_type_alias {
1525
1525
write ! ( w, "{}" , document( cx, it, None , HeadingOffset :: H2 ) ) ?;
1526
1526
}
1527
1527
@@ -1546,7 +1546,7 @@ fn item_enum(cx: &Context<'_>, it: &clean::Item, e: &clean::Enum) -> impl fmt::D
1546
1546
is_non_exhaustive : it. is_non_exhaustive ( ) ,
1547
1547
def_id : it. def_id ( ) . unwrap ( ) ,
1548
1548
}
1549
- . render_into ( cx, it, true , w)
1549
+ . render_into ( cx, it, false , w)
1550
1550
} )
1551
1551
}
1552
1552
@@ -1945,7 +1945,7 @@ impl<'a> DisplayStruct<'a> {
1945
1945
self ,
1946
1946
cx : & Context < ' _ > ,
1947
1947
it : & clean:: Item ,
1948
- document_struct : bool ,
1948
+ is_type_alias : bool ,
1949
1949
w : & mut W ,
1950
1950
) -> fmt:: Result {
1951
1951
wrap_item ( w, |w| {
@@ -1957,7 +1957,7 @@ impl<'a> DisplayStruct<'a> {
1957
1957
)
1958
1958
} ) ?;
1959
1959
1960
- if document_struct {
1960
+ if !is_type_alias {
1961
1961
write ! ( w, "{}" , document( cx, it, None , HeadingOffset :: H2 ) ) ?;
1962
1962
}
1963
1963
@@ -1975,7 +1975,7 @@ impl<'a> DisplayStruct<'a> {
1975
1975
fn item_struct ( cx : & Context < ' _ > , it : & clean:: Item , s : & clean:: Struct ) -> impl fmt:: Display {
1976
1976
fmt:: from_fn ( |w| {
1977
1977
DisplayStruct { ctor_kind : s. ctor_kind , generics : & s. generics , fields : s. fields . as_slice ( ) }
1978
- . render_into ( cx, it, true , w)
1978
+ . render_into ( cx, it, false , w)
1979
1979
} )
1980
1980
}
1981
1981
0 commit comments