@@ -9,7 +9,7 @@ use std::path::PathBuf;
99use serde:: { Deserialize , Serialize } ;
1010
1111/// rustdoc format-version.
12- pub const FORMAT_VERSION : u32 = 17 ;
12+ pub const FORMAT_VERSION : u32 = 18 ;
1313
1414/// A `Crate` is the root of the emitted JSON blob. It contains all type/documentation information
1515/// about the language items in the local crate, as well as info about external items to allow
@@ -133,7 +133,7 @@ pub struct DynTrait {
133133/// A trait and potential HRTBs
134134pub struct PolyTrait {
135135 #[ serde( rename = "trait" ) ]
136- pub trait_ : Type ,
136+ pub trait_ : Path ,
137137 /// Used for Higher-Rank Trait Bounds (HRTBs)
138138 /// ```text
139139 /// dyn for<'a> Fn() -> &'a i32"
@@ -447,7 +447,7 @@ pub enum WherePredicate {
447447pub enum GenericBound {
448448 TraitBound {
449449 #[ serde( rename = "trait" ) ]
450- trait_ : Type ,
450+ trait_ : Path ,
451451 /// Used for Higher-Rank Trait Bounds (HRTBs)
452452 /// ```text
453453 /// where F: for<'a, 'b> Fn(&'a u8, &'b u8)
@@ -481,12 +481,7 @@ pub enum Term {
481481#[ serde( tag = "kind" , content = "inner" ) ]
482482pub enum Type {
483483 /// 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 ) ,
490485 DynTrait ( DynTrait ) ,
491486 /// Parameterized types
492487 Generic ( String ) ,
@@ -527,10 +522,24 @@ pub enum Type {
527522 args : Box < GenericArgs > ,
528523 self_type : Box < Type > ,
529524 #[ serde( rename = "trait" ) ]
530- trait_ : Box < Type > ,
525+ trait_ : Path ,
531526 } ,
532527}
533528
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+
534543#[ derive( Clone , Debug , PartialEq , Eq , Hash , Serialize , Deserialize ) ]
535544pub struct FunctionPointer {
536545 pub decl : FnDecl ,
@@ -574,7 +583,7 @@ pub struct Impl {
574583 pub generics : Generics ,
575584 pub provided_trait_methods : Vec < String > ,
576585 #[ serde( rename = "trait" ) ]
577- pub trait_ : Option < Type > ,
586+ pub trait_ : Option < Path > ,
578587 #[ serde( rename = "for" ) ]
579588 pub for_ : Type ,
580589 pub items : Vec < Id > ,
0 commit comments