diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:20:39 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:20:39 +0000 |
commit | 1376c5a617be5c25655d0d7cb63e3beaa5a6e026 (patch) | |
tree | 3bb8d61aee02bc7a15eab3f36e3b921afc2075d0 /src/rustdoc-json-types | |
parent | Releasing progress-linux version 1.69.0+dfsg1-1~progress7.99u1. (diff) | |
download | rustc-1376c5a617be5c25655d0d7cb63e3beaa5a6e026.tar.xz rustc-1376c5a617be5c25655d0d7cb63e3beaa5a6e026.zip |
Merging upstream version 1.70.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/rustdoc-json-types')
-rw-r--r-- | src/rustdoc-json-types/Cargo.toml | 1 | ||||
-rw-r--r-- | src/rustdoc-json-types/lib.rs | 19 |
2 files changed, 10 insertions, 10 deletions
diff --git a/src/rustdoc-json-types/Cargo.toml b/src/rustdoc-json-types/Cargo.toml index d60699efd..d63caa7ad 100644 --- a/src/rustdoc-json-types/Cargo.toml +++ b/src/rustdoc-json-types/Cargo.toml @@ -8,6 +8,7 @@ path = "lib.rs" [dependencies] serde = { version = "1.0", features = ["derive"] } +rustc-hash = "1.1.0" [dev-dependencies] serde_json = "1.0" diff --git a/src/rustdoc-json-types/lib.rs b/src/rustdoc-json-types/lib.rs index 387d5787d..3cf8ceed6 100644 --- a/src/rustdoc-json-types/lib.rs +++ b/src/rustdoc-json-types/lib.rs @@ -3,10 +3,9 @@ //! These types are the public API exposed through the `--output-format json` flag. The [`Crate`] //! struct is the root of the JSON blob and all other items are contained within. -use std::collections::HashMap; -use std::path::PathBuf; - +use rustc_hash::FxHashMap; use serde::{Deserialize, Serialize}; +use std::path::PathBuf; /// rustdoc format-version. pub const FORMAT_VERSION: u32 = 24; @@ -24,11 +23,11 @@ pub struct Crate { pub includes_private: bool, /// A collection of all items in the local crate as well as some external traits and their /// items that are referenced locally. - pub index: HashMap<Id, Item>, + pub index: FxHashMap<Id, Item>, /// Maps IDs to fully qualified paths and other info helpful for generating links. - pub paths: HashMap<Id, ItemSummary>, + pub paths: FxHashMap<Id, ItemSummary>, /// Maps `crate_id` of items to a crate name and html_root_url if it exists. - pub external_crates: HashMap<u32, ExternalCrate>, + pub external_crates: FxHashMap<u32, ExternalCrate>, /// A single version number to be used in the future when making backwards incompatible changes /// to the JSON output. pub format_version: u32, @@ -54,8 +53,8 @@ pub struct ItemSummary { /// /// Note that items can appear in multiple paths, and the one chosen is implementation /// defined. Currently, 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. + /// [`String`] is currently `["alloc", "string", "String"]` and [`HashMap`][`std::collections::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, @@ -80,7 +79,7 @@ pub struct Item { /// Some("") if there is some documentation but it is empty (EG `#[doc = ""]`). pub docs: Option<String>, /// This mapping resolves [intra-doc links](https://github.com/rust-lang/rfcs/blob/master/text/1946-intra-rustdoc-links.md) from the docstring to their IDs - pub links: HashMap<String, Id>, + pub links: FxHashMap<String, Id>, /// Stringified versions of the attributes on this item (e.g. `"#[inline]"`) pub attrs: Vec<String>, pub deprecation: Option<Deprecation>, @@ -551,7 +550,7 @@ pub enum Type { DynTrait(DynTrait), /// Parameterized types Generic(String), - /// Built in numberic (i*, u*, f*) types, bool, and char + /// Built in numeric (i*, u*, f*) types, bool, and char Primitive(String), /// `extern "ABI" fn` FunctionPointer(Box<FunctionPointer>), |