|
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; |
@@ -304,10 +316,10 @@ pub enum AssocItemConstraintKind { |
304 | 316 | // FIXME(aDotInTheVoid): Consider making this non-public in rustdoc-types. |
305 | 317 | pub struct Id(pub u32); |
306 | 318 |
|
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. |
308 | 320 | /// |
309 | 321 | /// Part of [`ItemSummary`]. |
310 | | -#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] |
| 322 | +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] |
311 | 323 | #[serde(rename_all = "snake_case")] |
312 | 324 | pub enum ItemKind { |
313 | 325 | /// A module declaration, e.g. `mod foo;` or `mod foo {}` |
@@ -697,7 +709,7 @@ pub enum Abi { |
697 | 709 | Aapcs { unwind: bool }, |
698 | 710 | /// Can be specified as `extern "win64"`. |
699 | 711 | Win64 { unwind: bool }, |
700 | | - /// Can be specifed as `extern "sysv64"`. |
| 712 | + /// Can be specified as `extern "sysv64"`. |
701 | 713 | SysV64 { unwind: bool }, |
702 | 714 | /// Can be specified as `extern "system"`. |
703 | 715 | System { unwind: bool }, |
@@ -891,7 +903,7 @@ pub enum GenericBound { |
891 | 903 | } |
892 | 904 |
|
893 | 905 | /// 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)] |
895 | 907 | #[serde(rename_all = "snake_case")] |
896 | 908 | pub enum TraitBoundModifier { |
897 | 909 | /// Marks the absence of a modifier. |
@@ -995,7 +1007,7 @@ pub enum Type { |
995 | 1007 | QualifiedPath { |
996 | 1008 | /// The name of the associated type in the parent type. |
997 | 1009 | /// |
998 | | - /// ```ignore (incomplete expresssion) |
| 1010 | + /// ```ignore (incomplete expression) |
999 | 1011 | /// <core::array::IntoIter<u32, 42> as Iterator>::Item |
1000 | 1012 | /// // ^^^^ |
1001 | 1013 | /// ``` |
@@ -1082,7 +1094,7 @@ pub struct FunctionSignature { |
1082 | 1094 | #[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] |
1083 | 1095 | pub struct Trait { |
1084 | 1096 | /// Whether the trait is marked `auto` and is thus implemented automatically |
1085 | | - /// for all aplicable types. |
| 1097 | + /// for all applicable types. |
1086 | 1098 | pub is_auto: bool, |
1087 | 1099 | /// Whether the trait is marked as `unsafe`. |
1088 | 1100 | pub is_unsafe: bool, |
@@ -1192,7 +1204,7 @@ pub struct ProcMacro { |
1192 | 1204 | } |
1193 | 1205 |
|
1194 | 1206 | /// 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)] |
1196 | 1208 | #[serde(rename_all = "snake_case")] |
1197 | 1209 | pub enum MacroKind { |
1198 | 1210 | /// A bang macro `foo!()`. |
|
0 commit comments