summaryrefslogtreecommitdiffstats
path: root/src/rustdoc-json-types/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/rustdoc-json-types/lib.rs')
-rw-r--r--src/rustdoc-json-types/lib.rs15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/rustdoc-json-types/lib.rs b/src/rustdoc-json-types/lib.rs
index fb1830426..4bc91fc40 100644
--- a/src/rustdoc-json-types/lib.rs
+++ b/src/rustdoc-json-types/lib.rs
@@ -9,7 +9,7 @@ use std::path::PathBuf;
use serde::{Deserialize, Serialize};
/// rustdoc format-version.
-pub const FORMAT_VERSION: u32 = 21;
+pub const FORMAT_VERSION: u32 = 22;
/// A `Crate` is the root of the emitted JSON blob. It contains all type/documentation information
/// about the language items in the local crate, as well as info about external items to allow
@@ -51,6 +51,11 @@ pub struct ItemSummary {
pub crate_id: u32,
/// The list of path components for the fully qualified path of this item (e.g.
/// `["std", "io", "lazy", "Lazy"]` for `std::io::lazy::Lazy`).
+ ///
+ /// Note that items can appear in multiple paths, and the one chosen is implementation
+ /// defined. Currenty, this is the full path to where the item was defined. Eg
+ /// [`String`] is currently `["alloc", "string", "String"]` and [`HashMap`] is
+ /// `["std", "collections", "hash", "map", "HashMap"]`, but this is subject to change.
pub path: Vec<String>,
/// Whether this item is a struct, trait, macro, etc.
pub kind: ItemKind,
@@ -254,7 +259,7 @@ pub enum ItemEnum {
Macro(String),
ProcMacro(ProcMacro),
- PrimitiveType(String),
+ Primitive(Primitive),
AssocConst {
#[serde(rename = "type")]
@@ -709,5 +714,11 @@ pub struct Static {
pub expr: String,
}
+#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
+pub struct Primitive {
+ pub name: String,
+ pub impls: Vec<Id>,
+}
+
#[cfg(test)]
mod tests;