Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
5148dac
Don't treat const param default as projection
cijiugechu May 8, 2026
df09c56
Merge pull request #5026 from RalfJung/chmod-isolation
RalfJung May 11, 2026
2835a50
readme: clarify that isolation is not a proper sandbox
RalfJung May 11, 2026
9a01092
Merge pull request #5025 from RalfJung/no-sandbox
saethlin May 11, 2026
b38fd28
cargo update
RalfJung May 11, 2026
4f73f5f
bump rand
RalfJung May 11, 2026
a545a10
bump aes and getrandom
RalfJung May 11, 2026
76bb206
cargo update (cargo-miri)
RalfJung May 11, 2026
7b6bfee
cargo update (tests/deps)
RalfJung May 11, 2026
786275c
cargo update (miri-script)
RalfJung May 11, 2026
a28724f
cargo update (bench-cargo-miri)
RalfJung May 11, 2026
83ef431
Merge pull request #5027 from RalfJung/cargo-update
RalfJung May 11, 2026
a0da345
default all unknown weak extern statics to null
RalfJung May 9, 2026
8477a69
add support for Zprint-codegen-stats-json
stephenduong1004 May 11, 2026
bc7f829
Merge pull request #5015 from RalfJung/weak-externs
RalfJung May 11, 2026
353112d
Remove `TcpStream::peer_addr` check for TCP sockets
WhySoBad May 6, 2026
b11537f
remove transmutability feature
cijiugechu May 12, 2026
ffddc83
Merge pull request #5009 from WhySoBad/network-socket-fix-shutdown
RalfJung May 12, 2026
a33a737
add test for env::temp_dir
RalfJung May 12, 2026
f6c0d32
Add _mm512_permutex2var_epi8 shim support
elichai May 12, 2026
1c6ac11
implement GetTempPathW on Windows
RalfJung May 12, 2026
0bc6491
stub out confstr for macOS temp_dir
RalfJung May 12, 2026
a975fa1
Merge pull request #5029 from RalfJung/temp_dir
RalfJung May 12, 2026
e8499b7
Merge pull request #5030 from elichai/_mm512_permutex2var_epi8
RalfJung May 12, 2026
82a32a1
tests: use println to avoid reordering in GHA output
RalfJung May 12, 2026
e3f7882
fix configuring features for main './miri test' run
RalfJung May 12, 2026
bdd0dcd
bootstrap: remap windows-style OUT_DIR paths
paradoxicalguy May 12, 2026
764cceb
Merge pull request #5033 from RalfJung/ci
RalfJung May 12, 2026
96ac80a
Remove socket readiness after short reads/writes
WhySoBad May 10, 2026
7eff190
move some checks off of the macos runner
RalfJung May 12, 2026
57f718e
Merge pull request #5023 from WhySoBad/network-socket-epoll-edge-on-e…
RalfJung May 12, 2026
39a25b3
Merge pull request #5034 from RalfJung/ci-rebalance
RalfJung May 12, 2026
d2803c5
update lockfile and proc_macro_deps
RalfJung May 12, 2026
c56ef41
Rollup merge of #156472 - stephenduong1004:print-stats-json, r=nikoma…
JonathanBrouwer May 13, 2026
eb5d1d9
Rollup merge of #156504 - paradoxicalguy:windows-path-remap, r=bjorn3
JonathanBrouwer May 13, 2026
407a2b5
Rollup merge of #156513 - RalfJung:miri, r=RalfJung
JonathanBrouwer May 13, 2026
2efca0e
Rollup merge of #156325 - cijiugechu:generics-transmutefrom, r=BoxyUwU
JonathanBrouwer May 13, 2026
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
281 changes: 259 additions & 22 deletions Cargo.lock

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions compiler/rustc_codegen_llvm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,10 @@ impl CodegenBackend for LlvmCodegenBackend {
print!("{stats}");
}

fn print_statistics_json(&self) -> String {
llvm::build_string(|s| unsafe { llvm::LLVMRustPrintStatisticsJSON(s) }).unwrap()
}

fn link(
&self,
sess: &Session,
Expand Down
3 changes: 3 additions & 0 deletions compiler/rustc_codegen_llvm/src/llvm/ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2114,6 +2114,9 @@ unsafe extern "C" {
/// Prints the statistics collected by `-Zprint-codegen-stats`.
pub(crate) fn LLVMRustPrintStatistics(OutStr: &RustString);

/// Save the statistics collected by `-Zprint-codegen-stats-json`
pub(crate) fn LLVMRustPrintStatisticsJSON(OutStr: &RustString);

pub(crate) fn LLVMRustInlineAsmVerify(
Ty: &Type,
Constraints: *const c_uchar, // See "PTR_LEN_STR".
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_llvm/src/llvm_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ unsafe fn configure_llvm(sess: &Session) {
// Use non-zero `import-instr-limit` multiplier for cold callsites.
add("-import-cold-multiplier=0.1", false);

if sess.print_llvm_stats() {
if sess.print_llvm_stats() || sess.print_llvm_stats_json().is_some() {
add("-stats", false);
}

Expand Down
4 changes: 4 additions & 0 deletions compiler/rustc_codegen_ssa/src/traits/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@ pub trait CodegenBackend {

fn print_statistics(&self) {}

fn print_statistics_json(&self) -> String {
String::new()
}

/// This is called on the returned [`CompiledModules`] from [`join_codegen`](Self::join_codegen).
fn link(
&self,
Expand Down
16 changes: 16 additions & 0 deletions compiler/rustc_interface/src/queries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,22 @@ impl Linker {
codegen_backend.print_statistics()
}

if let Some(out_path) = sess.print_llvm_stats_json() {
let llvm_stats_json = codegen_backend.print_statistics_json();

if !llvm_stats_json.is_empty() {
if let Err(e) = std::fs::write(&out_path, llvm_stats_json) {
sess.dcx().err(format!("failed to write stats to {}: {}", out_path, e));
}
} else {
sess.dcx().warn(format!(
"requested to print LLVM statistics to JSON file {}, but the codegen backend \
did not provide any statistics",
out_path,
));
}
}

sess.timings.end_section(sess.dcx(), TimingSection::Codegen);

if sess.opts.incremental.is_some()
Expand Down
5 changes: 5 additions & 0 deletions compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,11 @@ extern "C" void LLVMRustPrintStatistics(RustStringRef OutBuf) {
llvm::PrintStatistics(OS);
}

extern "C" void LLVMRustPrintStatisticsJSON(RustStringRef OutBuf) {
auto OS = RawRustStringOstream(OutBuf);
llvm::PrintStatisticsJSON(OS);
}

// Some of the functions here rely on LLVM modules that may not always be
// available. As such, we only try to build it in the first place, if
// llvm.offload is enabled.
Expand Down
3 changes: 3 additions & 0 deletions compiler/rustc_session/src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2546,6 +2546,9 @@ options! {
#[rustc_lint_opt_deny_field_access("use `Session::print_codegen_stats` instead of this field")]
print_codegen_stats: bool = (false, parse_bool, [UNTRACKED],
"print codegen statistics (default: no)"),
#[rustc_lint_opt_deny_field_access("use `Session::print_llvm_stats_json` instead of this field")]
print_codegen_stats_json: Option<String> = (None, parse_opt_string, [UNTRACKED],
"print codegen statistics in JSON to a file (default: no)"),
print_llvm_passes: bool = (false, parse_bool, [UNTRACKED],
"print the LLVM optimization passes being run (default: no)"),
print_mono_items: bool = (false, parse_bool, [UNTRACKED],
Expand Down
4 changes: 4 additions & 0 deletions compiler/rustc_session/src/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,10 @@ impl Session {
self.opts.unstable_opts.print_codegen_stats
}

pub fn print_llvm_stats_json(&self) -> Option<&String> {
self.opts.unstable_opts.print_codegen_stats_json.as_ref()
}

pub fn verify_llvm_ir(&self) -> bool {
self.opts.unstable_opts.verify_llvm_ir || option_env!("RUSTC_VERIFY_LLVM_IR").is_some()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -867,7 +867,8 @@ impl<'tcx> TypeVisitor<TyCtxt<'tcx>> for IllegalSelfTypeVisitor<'tcx> {
ty::ConstKind::Unevaluated(proj) if self.tcx.features().min_generic_const_args() => {
match self.allow_self_projections {
AllowSelfProjections::Yes
if let trait_def_id = self.tcx.parent(proj.def)
if matches!(self.tcx.def_kind(proj.def), DefKind::AssocConst { .. })
&& let trait_def_id = self.tcx.parent(proj.def)
&& self.tcx.def_kind(trait_def_id) == DefKind::Trait =>
{
let trait_ref = ty::TraitRef::from_assoc(self.tcx, trait_def_id, proj.args);
Expand Down
12 changes: 12 additions & 0 deletions src/bootstrap/src/core/builder/cargo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1079,6 +1079,12 @@ impl Builder<'_> {
format!("{}={map_to}", self.build.src.display()),
// remap OUT_DIR so they don't leak into artifacts.
format!("{}={map_to}/out", self.build.out.display()),
// on windows, rustc may use forward slashes internally
#[cfg(windows)]
format!(
"{}={map_to}\\out",
self.build.out.display().to_string().replace('/', "\\")
),
]
.join("\t");
cargo.env("RUSTC_DEBUGINFO_MAP", map);
Expand All @@ -1101,6 +1107,12 @@ impl Builder<'_> {
format!("{}={map_to}", self.build.src.display()),
// remap OUT_DIR so they don't leak into artifacts.
format!("{}={map_to}/out", self.build.out.display()),
// on windows, rustc may use forward slashes internally
#[cfg(windows)]
format!(
"{}={map_to}\\out",
self.build.out.display().to_string().replace('/', "\\")
),
]
.join("\t");
cargo.env("RUSTC_DEBUGINFO_MAP", map);
Expand Down
19 changes: 19 additions & 0 deletions src/bootstrap/src/utils/proc_macro_deps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@
/// See <https://github.com/rust-lang/rust/issues/134863>
pub static CRATES: &[&str] = &[
// tidy-alphabetical-start
"allocator-api2",
"anyhow",
"askama_derive",
"askama_parser",
"basic-toml",
"bitflags",
"block-buffer",
"bumpalo",
"cfg-if",
Expand All @@ -25,24 +28,32 @@ pub static CRATES: &[&str] = &[
"glob",
"hashbrown",
"heck",
"id-arena",
"ident_case",
"indexmap",
"intl-memoizer",
"intl_pluralrules",
"itoa",
"leb128fmt",
"libc",
"log",
"memchr",
"minimal-lexical",
"nom",
"pest",
"pest_generator",
"pest_meta",
"prettyplease",
"proc-macro2",
"quote",
"rustc-hash",
"ryu",
"self_cell",
"semver",
"serde",
"serde_core",
"serde_derive_internals",
"serde_json",
"sha2",
"smallvec",
"stable_deref_trait",
Expand All @@ -58,10 +69,18 @@ pub static CRATES: &[&str] = &[
"unic-langid-impl",
"unic-langid-macros",
"unicode-ident",
"unicode-xid",
"version_check",
"wasm-bindgen-macro-support",
"wasm-bindgen-shared",
"wasm-encoder",
"wasm-metadata",
"wasmparser",
"winnow",
"wit-bindgen-core",
"wit-bindgen-rust",
"wit-component",
"wit-parser",
"yoke",
"zerofrom",
"zerovec",
Expand Down
Loading
Loading