@@ -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 = 17 ;
12
+ pub const FORMAT_VERSION : u32 = 18 ;
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
@@ -133,7 +133,7 @@ pub struct DynTrait {
133
133
/// A trait and potential HRTBs
134
134
pub struct PolyTrait {
135
135
#[ serde( rename = "trait" ) ]
136
- pub trait_ : Type ,
136
+ pub trait_ : Path ,
137
137
/// Used for Higher-Rank Trait Bounds (HRTBs)
138
138
/// ```text
139
139
/// dyn for<'a> Fn() -> &'a i32"
@@ -447,7 +447,7 @@ pub enum WherePredicate {
447
447
pub enum GenericBound {
448
448
TraitBound {
449
449
#[ serde( rename = "trait" ) ]
450
- trait_ : Type ,
450
+ trait_ : Path ,
451
451
/// Used for Higher-Rank Trait Bounds (HRTBs)
452
452
/// ```text
453
453
/// where F: for<'a, 'b> Fn(&'a u8, &'b u8)
@@ -481,12 +481,7 @@ pub enum Term {
481
481
#[ serde( tag = "kind" , content = "inner" ) ]
482
482
pub enum Type {
483
483
/// Structs, enums, and traits
484
- ResolvedPath {
485
- name : String ,
486
- id : Id ,
487
- args : Option < Box < GenericArgs > > ,
488
- param_names : Vec < GenericBound > ,
489
- } ,
484
+ ResolvedPath ( Path ) ,
490
485
DynTrait ( DynTrait ) ,
491
486
/// Parameterized types
492
487
Generic ( String ) ,
@@ -527,10 +522,24 @@ pub enum Type {
527
522
args : Box < GenericArgs > ,
528
523
self_type : Box < Type > ,
529
524
#[ serde( rename = "trait" ) ]
530
- trait_ : Box < Type > ,
525
+ trait_ : Path ,
531
526
} ,
532
527
}
533
528
529
+ #[ derive( Clone , Debug , PartialEq , Eq , Hash , Serialize , Deserialize ) ]
530
+ pub struct Path {
531
+ pub name : String ,
532
+ pub id : Id ,
533
+ /// Generic arguments to the type
534
+ /// ```test
535
+ /// std::borrow::Cow<'static, str>
536
+ /// ^^^^^^^^^^^^^^
537
+ /// |
538
+ /// this part
539
+ /// ```
540
+ pub args : Option < Box < GenericArgs > > ,
541
+ }
542
+
534
543
#[ derive( Clone , Debug , PartialEq , Eq , Hash , Serialize , Deserialize ) ]
535
544
pub struct FunctionPointer {
536
545
pub decl : FnDecl ,
@@ -574,7 +583,7 @@ pub struct Impl {
574
583
pub generics : Generics ,
575
584
pub provided_trait_methods : Vec < String > ,
576
585
#[ serde( rename = "trait" ) ]
577
- pub trait_ : Option < Type > ,
586
+ pub trait_ : Option < Path > ,
578
587
#[ serde( rename = "for" ) ]
579
588
pub for_ : Type ,
580
589
pub items : Vec < Id > ,
0 commit comments