From 4810a9ae425cc23cf14cc75526a1da6ecda2de3c Mon Sep 17 00:00:00 2001 From: Alona Enraght-Moony Date: Wed, 23 Oct 2024 12:26:32 +0100 Subject: [PATCH] v0.32.2 --- CHANGELOG.md | 13 ++++++++++++- COMMIT.txt | 2 +- Cargo.toml | 2 +- src/lib.rs | 26 +++++++++++++++++++------- 4 files changed, 33 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7817e3c..fc8fb73 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,20 @@ + +# [v0.32.2](https://github.com/aDotInTheVoid/rustdoc-types/releases/tag/v0.32.2) - 2024-10-23 + +**Library Improvement**: `ItemKind`, `TraitBoundModifier`, and `MacroKind` all now implement `Copy` ([rust#131976](https://github.com/rust-lang/rust/pull/131976)). + +- Format Version: 36 +- Upstream Commit: [`4b658657da324253a201fc7baf70d106db5df7e0`](https://github.com/rust-lang/rust/commit/4b658657da324253a201fc7baf70d106db5df7e0) +- Diff: [v0.32.1...v0.32.2](https://github.com/aDotInTheVoid/rustdoc-types/compare/v0.32.1...v0.32.2) + # [v0.32.1](https://github.com/aDotInTheVoid/rustdoc-types/releases/tag/v0.32.1) - 2024-10-20 **New Feature**: The optional `rustc-hash` cargo feature has been added. This changes the hashing algorithm used to [a speedy non-cryptographic hashing algorith](https://github.com/rust-lang/rustc-hash) also used in rustc. -This has lead to [modest but appreciable](https://rust-lang.zulipchat.com/#narrow/channel/266220-t-rustdoc/topic/rustc-hash.20and.20performance.20of.20rustdoc-types/near/474855731) performace gains for some consumers. +This has lead to [modest but appreciable](https://rust-lang.zulipchat.com/#narrow/channel/266220-t-rustdoc/topic/rustc-hash.20and.20performance.20of.20rustdoc-types/near/474855731) performace gains for some consumers +([#42](https://github.com/rust-lang/rustdoc-types/pull/42), [rust#131936](https://github.com/rust-lang/rust/pull/131936)). + - Format Version: 36 - Upstream Commit: [`d1fa49b2e66c343210c413b68ed57f150b7b89d8`](https://github.com/rust-lang/rust/commit/d1fa49b2e66c343210c413b68ed57f150b7b89d8) diff --git a/COMMIT.txt b/COMMIT.txt index 94e66a0..aa5278a 100644 --- a/COMMIT.txt +++ b/COMMIT.txt @@ -1 +1 @@ -d1fa49b2e66c343210c413b68ed57f150b7b89d8 +4b658657da324253a201fc7baf70d106db5df7e0 diff --git a/Cargo.toml b/Cargo.toml index d142076..9427b59 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rustdoc-types" -version = "0.32.1" +version = "0.32.2" edition = "2018" license = "MIT OR Apache-2.0" description = "Types for rustdoc's json output" diff --git a/src/lib.rs b/src/lib.rs index 231625b..68177fe 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -2,6 +2,18 @@ //! //! 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. +//! +//! We expose a `rustc-hash` feature that is disabled by default. This feature switches the +//! [`std::collections::HashMap`] for [`rustc_hash::FxHashMap`] to improve the performance of said +//! `HashMap` in specific situations. +//! +//! `cargo-semver-checks` for example, saw a [-3% improvement][1] when benchmarking using the +//! `aws_sdk_ec2` JSON output (~500MB of JSON). As always, we recommend measuring the impact before +//! turning this feature on, as [`FxHashMap`][2] only concerns itself with hash speed, and may +//! increase the number of collisions. +//! +//! [1]: https://rust-lang.zulipchat.com/#narrow/channel/266220-t-rustdoc/topic/rustc-hash.20and.20performance.20of.20rustdoc-types/near/474855731 +//! [2]: https://crates.io/crates/rustc-hash #[cfg(not(feature = "rustc-hash"))] use std::collections::HashMap; @@ -304,10 +316,10 @@ pub enum AssocItemConstraintKind { // FIXME(aDotInTheVoid): Consider making this non-public in rustdoc-types. pub struct Id(pub u32); -/// The fundamental kind of an item. Unlike [`ItemEnum`], this does not carry any aditional info. +/// The fundamental kind of an item. Unlike [`ItemEnum`], this does not carry any additional info. /// /// Part of [`ItemSummary`]. -#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] pub enum ItemKind { /// A module declaration, e.g. `mod foo;` or `mod foo {}` @@ -697,7 +709,7 @@ pub enum Abi { Aapcs { unwind: bool }, /// Can be specified as `extern "win64"`. Win64 { unwind: bool }, - /// Can be specifed as `extern "sysv64"`. + /// Can be specified as `extern "sysv64"`. SysV64 { unwind: bool }, /// Can be specified as `extern "system"`. System { unwind: bool }, @@ -891,7 +903,7 @@ pub enum GenericBound { } /// A set of modifiers applied to a trait. -#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] pub enum TraitBoundModifier { /// Marks the absence of a modifier. @@ -995,7 +1007,7 @@ pub enum Type { QualifiedPath { /// The name of the associated type in the parent type. /// - /// ```ignore (incomplete expresssion) + /// ```ignore (incomplete expression) /// as Iterator>::Item /// // ^^^^ /// ``` @@ -1082,7 +1094,7 @@ pub struct FunctionSignature { #[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] pub struct Trait { /// Whether the trait is marked `auto` and is thus implemented automatically - /// for all aplicable types. + /// for all applicable types. pub is_auto: bool, /// Whether the trait is marked as `unsafe`. pub is_unsafe: bool, @@ -1192,7 +1204,7 @@ pub struct ProcMacro { } /// The way a [`ProcMacro`] is declared to be used. -#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] pub enum MacroKind { /// A bang macro `foo!()`.