@@ -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 = 22 ;
12
+ pub const FORMAT_VERSION : u32 = 23 ;
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
@@ -51,6 +51,11 @@ pub struct ItemSummary {
51
51
pub crate_id : u32 ,
52
52
/// The list of path components for the fully qualified path of this item (e.g.
53
53
/// `["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.
54
59
pub path : Vec < String > ,
55
60
/// Whether this item is a struct, trait, macro, etc.
56
61
pub kind : ItemKind ,
@@ -205,7 +210,6 @@ pub enum ItemKind {
205
210
Constant ,
206
211
Trait ,
207
212
TraitAlias ,
208
- Method ,
209
213
Impl ,
210
214
Static ,
211
215
ForeignType ,
@@ -238,7 +242,6 @@ pub enum ItemEnum {
238
242
239
243
Trait ( Trait ) ,
240
244
TraitAlias ( TraitAlias ) ,
241
- Method ( Method ) ,
242
245
Impl ( Impl ) ,
243
246
244
247
Typedef ( Typedef ) ,
@@ -346,7 +349,7 @@ pub enum Variant {
346
349
/// A variant with unnamed fields.
347
350
///
348
351
/// 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.
350
353
///
351
354
/// ```rust
352
355
/// enum Demo {
@@ -410,18 +413,12 @@ pub enum Abi {
410
413
Other ( String ) ,
411
414
}
412
415
416
+ /// Represents a function (including methods and other associated functions)
413
417
#[ derive( Clone , Debug , PartialEq , Eq , Hash , Serialize , Deserialize ) ]
414
418
pub struct Function {
415
419
pub decl : FnDecl ,
416
420
pub generics : Generics ,
417
421
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 ,
425
422
pub has_body : bool ,
426
423
}
427
424
0 commit comments