Skip to content

Rollup of 6 pull requests #142719

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 20 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
32cb8f1
Add trim_prefix and trim_suffix for slice and str.
deven Jun 11, 2025
b391494
add ChildExt(::send_signal)
Qelxiros Jun 18, 2025
c6e77b3
Reduce uses of `hir_crate`.
cjgillot Jun 18, 2025
7fa94af
Make feature suggestion more consistent.
cjgillot Jun 18, 2025
0a4507c
rustdoc_json: Add static asserts for the size of important types.
nnethercote Jun 14, 2025
82f8220
rustdoc_json: Add a test for some `GenericArgs` cases.
nnethercote Jun 15, 2025
74371ca
rustdoc_json: Fix handling of paths with no generic args.
nnethercote Jun 14, 2025
dba34b3
Fix some comments.
nnethercote Jun 14, 2025
91818ba
rustdoc_json: represent generic args consistently.
nnethercote Jun 14, 2025
8c28161
Add `get_host_target` function
Kobzol Jun 17, 2025
21d21d5
Normalize host target in snapshot tests
Kobzol Jun 17, 2025
718e475
Clarify arrow in snapshot tests
Kobzol Jun 18, 2025
7760f8e
add comment to `src/bootstrap/build.rs`
fee1-dead Jun 19, 2025
ede4891
Update compiler/rustc_interface/src/passes.rs
cjgillot Jun 19, 2025
78b0c7a
Rollup merge of #141990 - Qelxiros:141975-unix_send_signal, r=ChrisDe…
Kobzol Jun 19, 2025
e3db382
Rollup merge of #142331 - deven:trim_prefix_suffix, r=Amanieu
Kobzol Jun 19, 2025
3d368e2
Rollup merge of #142502 - nnethercote:rustdoc-json-GenericArgs, r=aDo…
Kobzol Jun 19, 2025
7d79d26
Rollup merge of #142629 - Kobzol:bootstrap-tests-builder, r=jieyouxu,…
Kobzol Jun 19, 2025
fe5842c
Rollup merge of #142687 - cjgillot:less-hir_crate, r=oli-obk
Kobzol Jun 19, 2025
a8bc0f4
Rollup merge of #142714 - fee1-dead-contrib:push-roxtwrlvtzur, r=Kobzol
Kobzol Jun 19, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
rustdoc_json: Add static asserts for the size of important types.
A lot of these are large! Lots of room for improvement in the future.
  • Loading branch information
nnethercote committed Jun 19, 2025
commit 0a4507cf64ef26463e24b41d14c576cd31f2a8ce
30 changes: 30 additions & 0 deletions src/librustdoc/json/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -382,3 +382,33 @@ impl<'tcx> FormatRenderer<'tcx> for JsonRenderer<'tcx> {
&self.cache
}
}

// Some nodes are used a lot. Make sure they don't unintentionally get bigger.
//
// These assertions are here, not in `src/rustdoc-json-types/lib.rs` where the types are defined,
// because we have access to `static_assert_size` here.
#[cfg(target_pointer_width = "64")]
mod size_asserts {
use rustc_data_structures::static_assert_size;

use super::types::*;
// tidy-alphabetical-start
static_assert_size!(AssocItemConstraint, 208);
static_assert_size!(Crate, 184);
static_assert_size!(ExternalCrate, 48);
static_assert_size!(FunctionPointer, 168);
static_assert_size!(GenericArg, 80);
static_assert_size!(GenericArgs, 104);
static_assert_size!(GenericBound, 72);
static_assert_size!(GenericParamDef, 136);
static_assert_size!(Impl, 304);
// `Item` contains a `PathBuf`, which is different sizes on different OSes.
static_assert_size!(Item, 528 + size_of::<std::path::PathBuf>());
static_assert_size!(ItemSummary, 32);
static_assert_size!(PolyTrait, 64);
static_assert_size!(PreciseCapturingArg, 32);
static_assert_size!(TargetFeature, 80);
static_assert_size!(Type, 80);
static_assert_size!(WherePredicate, 160);
// tidy-alphabetical-end
}