@@ -9,7 +9,7 @@ use std::path::PathBuf;
99use serde:: { Deserialize , Serialize } ;
1010
1111/// rustdoc format-version.
12- pub const FORMAT_VERSION : u32 = 22 ;
12+ pub const FORMAT_VERSION : u32 = 23 ;
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
@@ -51,6 +51,11 @@ pub struct ItemSummary {
5151 pub crate_id : u32 ,
5252 /// The list of path components for the fully qualified path of this item (e.g.
5353 /// `["std", "io", "lazy", "Lazy"]` for `std::io::lazy::Lazy`).
54+ ///
55+ /// Note that items can appear in multiple paths, and the one chosen is implementation
56+ /// defined. Currently, this is the full path to where the item was defined. Eg
57+ /// [`String`] is currently `["alloc", "string", "String"]` and [`HashMap`] is
58+ /// `["std", "collections", "hash", "map", "HashMap"]`, but this is subject to change.
5459 pub path : Vec < String > ,
5560 /// Whether this item is a struct, trait, macro, etc.
5661 pub kind : ItemKind ,
@@ -205,7 +210,6 @@ pub enum ItemKind {
205210 Constant ,
206211 Trait ,
207212 TraitAlias ,
208- Method ,
209213 Impl ,
210214 Static ,
211215 ForeignType ,
@@ -238,7 +242,6 @@ pub enum ItemEnum {
238242
239243 Trait ( Trait ) ,
240244 TraitAlias ( TraitAlias ) ,
241- Method ( Method ) ,
242245 Impl ( Impl ) ,
243246
244247 Typedef ( Typedef ) ,
@@ -346,7 +349,7 @@ pub enum Variant {
346349 /// A variant with unnamed fields.
347350 ///
348351 /// Unlike most of json, `#[doc(hidden)]` fields will be given as `None`
349- /// instead of being ommited , because order matters.
352+ /// instead of being omitted , because order matters.
350353 ///
351354 /// ```rust
352355 /// enum Demo {
@@ -410,18 +413,12 @@ pub enum Abi {
410413 Other ( String ) ,
411414}
412415
416+ /// Represents a function (including methods and other associated functions)
413417#[ derive( Clone , Debug , PartialEq , Eq , Hash , Serialize , Deserialize ) ]
414418pub struct Function {
415419 pub decl : FnDecl ,
416420 pub generics : Generics ,
417421 pub header : Header ,
418- }
419-
420- #[ derive( Clone , Debug , PartialEq , Eq , Hash , Serialize , Deserialize ) ]
421- pub struct Method {
422- pub decl : FnDecl ,
423- pub generics : Generics ,
424- pub header : Header ,
425422 pub has_body : bool ,
426423}
427424
0 commit comments