File tree 3 files changed +6
-20
lines changed
3 files changed +6
-20
lines changed Original file line number Diff line number Diff line change @@ -143,10 +143,7 @@ def check_type(ty):
143
143
set (item ["inner" ]["variants" ]) | set (item ["inner" ]["impls" ])
144
144
) - visited
145
145
elif item ["kind" ] == "variant" :
146
- if item ["inner" ]["variant_kind" ] == "tuple" :
147
- for ty in item ["inner" ]["variant_inner" ]:
148
- check_type (ty )
149
- elif item ["inner" ]["variant_kind" ] == "struct" :
146
+ if item ["inner" ]["variant_kind" ] == "struct" or item ["inner" ]["variant_kind" ] == "tuple" :
150
147
work_list |= set (item ["inner" ]["variant_inner" ]) - visited
151
148
elif item ["kind" ] in ("function" , "method" ):
152
149
check_generics (item ["inner" ]["generics" ])
Original file line number Diff line number Diff line change @@ -602,22 +602,11 @@ impl FromWithTcx<clean::VariantStruct> for Struct {
602
602
}
603
603
604
604
impl FromWithTcx < clean:: Variant > for Variant {
605
- fn from_tcx ( variant : clean:: Variant , tcx : TyCtxt < ' _ > ) -> Self {
605
+ fn from_tcx ( variant : clean:: Variant , _tcx : TyCtxt < ' _ > ) -> Self {
606
606
use clean:: Variant :: * ;
607
607
match variant {
608
608
CLike => Variant :: Plain ,
609
- Tuple ( fields) => Variant :: Tuple (
610
- fields
611
- . into_iter ( )
612
- . map ( |f| {
613
- if let clean:: StructFieldItem ( ty) = * f. kind {
614
- ty. into_tcx ( tcx)
615
- } else {
616
- unreachable ! ( )
617
- }
618
- } )
619
- . collect ( ) ,
620
- ) ,
609
+ Tuple ( fields) => Variant :: Tuple ( ids ( fields) ) ,
621
610
Struct ( s) => Variant :: Struct ( ids ( s. fields ) ) ,
622
611
}
623
612
}
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ use std::path::PathBuf;
9
9
use serde:: { Deserialize , Serialize } ;
10
10
11
11
/// rustdoc format-version.
12
- pub const FORMAT_VERSION : u32 = 14 ;
12
+ pub const FORMAT_VERSION : u32 = 15 ;
13
13
14
14
/// A `Crate` is the root of the emitted JSON blob. It contains all type/documentation information
15
15
/// about the language items in the local crate, as well as info about external items to allow
@@ -277,7 +277,7 @@ pub struct Enum {
277
277
#[ serde( tag = "variant_kind" , content = "variant_inner" ) ]
278
278
pub enum Variant {
279
279
Plain ,
280
- Tuple ( Vec < Type > ) ,
280
+ Tuple ( Vec < Id > ) ,
281
281
Struct ( Vec < Id > ) ,
282
282
}
283
283
@@ -451,7 +451,7 @@ pub enum Type {
451
451
Tuple ( Vec < Type > ) ,
452
452
/// `[u32]`
453
453
Slice ( Box < Type > ) ,
454
- /// [u32; 15]
454
+ /// ` [u32; 15]`
455
455
Array {
456
456
#[ serde( rename = "type" ) ]
457
457
type_ : Box < Type > ,
You can’t perform that action at this time.
0 commit comments