Skip to content

Commit

Permalink
v0.32.2
Browse files Browse the repository at this point in the history
  • Loading branch information
aDotInTheVoid committed Oct 23, 2024
1 parent 47b62d6 commit 4810a9a
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 10 deletions.
13 changes: 12 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
<a name="v0.32.2"></a>
# [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)

<a name="v0.32.1"></a>
# [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)
Expand Down
2 changes: 1 addition & 1 deletion COMMIT.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
d1fa49b2e66c343210c413b68ed57f150b7b89d8
4b658657da324253a201fc7baf70d106db5df7e0
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
26 changes: 19 additions & 7 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 {}`
Expand Down Expand Up @@ -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 },
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -995,7 +1007,7 @@ pub enum Type {
QualifiedPath {
/// The name of the associated type in the parent type.
///
/// ```ignore (incomplete expresssion)
/// ```ignore (incomplete expression)
/// <core::array::IntoIter<u32, 42> as Iterator>::Item
/// // ^^^^
/// ```
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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!()`.
Expand Down

0 comments on commit 4810a9a

Please sign in to comment.