|
2 | 2 | //!
|
3 | 3 | //! These types are the public API exposed through the `--output-format json` flag. The [`Crate`]
|
4 | 4 | //! 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 |
5 | 17 |
|
6 | 18 | #[cfg(not(feature = "rustc-hash"))]
|
7 | 19 | use std::collections::HashMap;
|
@@ -305,10 +317,10 @@ pub enum AssocItemConstraintKind {
|
305 | 317 | // FIXME(aDotInTheVoid): Consider making this non-public in rustdoc-types.
|
306 | 318 | pub struct Id(pub u32);
|
307 | 319 |
|
308 |
| -/// The fundamental kind of an item. Unlike [`ItemEnum`], this does not carry any aditional info. |
| 320 | +/// The fundamental kind of an item. Unlike [`ItemEnum`], this does not carry any additional info. |
309 | 321 | ///
|
310 | 322 | /// Part of [`ItemSummary`].
|
311 |
| -#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] |
| 323 | +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] |
312 | 324 | #[serde(rename_all = "snake_case")]
|
313 | 325 | pub enum ItemKind {
|
314 | 326 | /// A module declaration, e.g. `mod foo;` or `mod foo {}`
|
@@ -698,7 +710,7 @@ pub enum Abi {
|
698 | 710 | Aapcs { unwind: bool },
|
699 | 711 | /// Can be specified as `extern "win64"`.
|
700 | 712 | Win64 { unwind: bool },
|
701 |
| - /// Can be specifed as `extern "sysv64"`. |
| 713 | + /// Can be specified as `extern "sysv64"`. |
702 | 714 | SysV64 { unwind: bool },
|
703 | 715 | /// Can be specified as `extern "system"`.
|
704 | 716 | System { unwind: bool },
|
@@ -892,7 +904,7 @@ pub enum GenericBound {
|
892 | 904 | }
|
893 | 905 |
|
894 | 906 | /// A set of modifiers applied to a trait.
|
895 |
| -#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] |
| 907 | +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] |
896 | 908 | #[serde(rename_all = "snake_case")]
|
897 | 909 | pub enum TraitBoundModifier {
|
898 | 910 | /// Marks the absence of a modifier.
|
@@ -996,7 +1008,7 @@ pub enum Type {
|
996 | 1008 | QualifiedPath {
|
997 | 1009 | /// The name of the associated type in the parent type.
|
998 | 1010 | ///
|
999 |
| - /// ```ignore (incomplete expresssion) |
| 1011 | + /// ```ignore (incomplete expression) |
1000 | 1012 | /// <core::array::IntoIter<u32, 42> as Iterator>::Item
|
1001 | 1013 | /// // ^^^^
|
1002 | 1014 | /// ```
|
@@ -1083,7 +1095,7 @@ pub struct FunctionSignature {
|
1083 | 1095 | #[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
1084 | 1096 | pub struct Trait {
|
1085 | 1097 | /// Whether the trait is marked `auto` and is thus implemented automatically
|
1086 |
| - /// for all aplicable types. |
| 1098 | + /// for all applicable types. |
1087 | 1099 | pub is_auto: bool,
|
1088 | 1100 | /// Whether the trait is marked as `unsafe`.
|
1089 | 1101 | pub is_unsafe: bool,
|
@@ -1193,7 +1205,7 @@ pub struct ProcMacro {
|
1193 | 1205 | }
|
1194 | 1206 |
|
1195 | 1207 | /// The way a [`ProcMacro`] is declared to be used.
|
1196 |
| -#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] |
| 1208 | +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] |
1197 | 1209 | #[serde(rename_all = "snake_case")]
|
1198 | 1210 | pub enum MacroKind {
|
1199 | 1211 | /// A bang macro `foo!()`.
|
|
0 commit comments