Skip to content

Commit 4810a9a

Browse files
committed
v0.32.2
1 parent 47b62d6 commit 4810a9a

File tree

4 files changed

+33
-10
lines changed

4 files changed

+33
-10
lines changed

CHANGELOG.md

+12-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,20 @@
1+
<a name="v0.32.2"></a>
2+
# [v0.32.2](https://github.com/aDotInTheVoid/rustdoc-types/releases/tag/v0.32.2) - 2024-10-23
3+
4+
**Library Improvement**: `ItemKind`, `TraitBoundModifier`, and `MacroKind` all now implement `Copy` ([rust#131976](https://github.com/rust-lang/rust/pull/131976)).
5+
6+
- Format Version: 36
7+
- Upstream Commit: [`4b658657da324253a201fc7baf70d106db5df7e0`](https://github.com/rust-lang/rust/commit/4b658657da324253a201fc7baf70d106db5df7e0)
8+
- Diff: [v0.32.1...v0.32.2](https://github.com/aDotInTheVoid/rustdoc-types/compare/v0.32.1...v0.32.2)
9+
110
<a name="v0.32.1"></a>
211
# [v0.32.1](https://github.com/aDotInTheVoid/rustdoc-types/releases/tag/v0.32.1) - 2024-10-20
312

413
**New Feature**: The optional `rustc-hash` cargo feature has been added.
514
This changes the hashing algorithm used to [a speedy non-cryptographic hashing algorith](https://github.com/rust-lang/rustc-hash) also used in rustc.
6-
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.
15+
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
16+
([#42](https://github.com/rust-lang/rustdoc-types/pull/42), [rust#131936](https://github.com/rust-lang/rust/pull/131936)).
17+
718

819
- Format Version: 36
920
- Upstream Commit: [`d1fa49b2e66c343210c413b68ed57f150b7b89d8`](https://github.com/rust-lang/rust/commit/d1fa49b2e66c343210c413b68ed57f150b7b89d8)

COMMIT.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
d1fa49b2e66c343210c413b68ed57f150b7b89d8
1+
4b658657da324253a201fc7baf70d106db5df7e0

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "rustdoc-types"
3-
version = "0.32.1"
3+
version = "0.32.2"
44
edition = "2018"
55
license = "MIT OR Apache-2.0"
66
description = "Types for rustdoc's json output"

src/lib.rs

+19-7
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,18 @@
22
//!
33
//! These types are the public API exposed through the `--output-format json` flag. The [`Crate`]
44
//! struct is the root of the JSON blob and all other items are contained within.
5+
//!
6+
//! We expose a `rustc-hash` feature that is disabled by default. This feature switches the
7+
//! [`std::collections::HashMap`] for [`rustc_hash::FxHashMap`] to improve the performance of said
8+
//! `HashMap` in specific situations.
9+
//!
10+
//! `cargo-semver-checks` for example, saw a [-3% improvement][1] when benchmarking using the
11+
//! `aws_sdk_ec2` JSON output (~500MB of JSON). As always, we recommend measuring the impact before
12+
//! turning this feature on, as [`FxHashMap`][2] only concerns itself with hash speed, and may
13+
//! increase the number of collisions.
14+
//!
15+
//! [1]: https://rust-lang.zulipchat.com/#narrow/channel/266220-t-rustdoc/topic/rustc-hash.20and.20performance.20of.20rustdoc-types/near/474855731
16+
//! [2]: https://crates.io/crates/rustc-hash
517
618
#[cfg(not(feature = "rustc-hash"))]
719
use std::collections::HashMap;
@@ -304,10 +316,10 @@ pub enum AssocItemConstraintKind {
304316
// FIXME(aDotInTheVoid): Consider making this non-public in rustdoc-types.
305317
pub struct Id(pub u32);
306318

307-
/// The fundamental kind of an item. Unlike [`ItemEnum`], this does not carry any aditional info.
319+
/// The fundamental kind of an item. Unlike [`ItemEnum`], this does not carry any additional info.
308320
///
309321
/// Part of [`ItemSummary`].
310-
#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
322+
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
311323
#[serde(rename_all = "snake_case")]
312324
pub enum ItemKind {
313325
/// A module declaration, e.g. `mod foo;` or `mod foo {}`
@@ -697,7 +709,7 @@ pub enum Abi {
697709
Aapcs { unwind: bool },
698710
/// Can be specified as `extern "win64"`.
699711
Win64 { unwind: bool },
700-
/// Can be specifed as `extern "sysv64"`.
712+
/// Can be specified as `extern "sysv64"`.
701713
SysV64 { unwind: bool },
702714
/// Can be specified as `extern "system"`.
703715
System { unwind: bool },
@@ -891,7 +903,7 @@ pub enum GenericBound {
891903
}
892904

893905
/// A set of modifiers applied to a trait.
894-
#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
906+
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
895907
#[serde(rename_all = "snake_case")]
896908
pub enum TraitBoundModifier {
897909
/// Marks the absence of a modifier.
@@ -995,7 +1007,7 @@ pub enum Type {
9951007
QualifiedPath {
9961008
/// The name of the associated type in the parent type.
9971009
///
998-
/// ```ignore (incomplete expresssion)
1010+
/// ```ignore (incomplete expression)
9991011
/// <core::array::IntoIter<u32, 42> as Iterator>::Item
10001012
/// // ^^^^
10011013
/// ```
@@ -1082,7 +1094,7 @@ pub struct FunctionSignature {
10821094
#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
10831095
pub struct Trait {
10841096
/// Whether the trait is marked `auto` and is thus implemented automatically
1085-
/// for all aplicable types.
1097+
/// for all applicable types.
10861098
pub is_auto: bool,
10871099
/// Whether the trait is marked as `unsafe`.
10881100
pub is_unsafe: bool,
@@ -1192,7 +1204,7 @@ pub struct ProcMacro {
11921204
}
11931205

11941206
/// The way a [`ProcMacro`] is declared to be used.
1195-
#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
1207+
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
11961208
#[serde(rename_all = "snake_case")]
11971209
pub enum MacroKind {
11981210
/// A bang macro `foo!()`.

0 commit comments

Comments
 (0)