Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
b51a8ed
test(rustfmt): Verify frontmatter is preserved
epage Aug 8, 2025
e50fed7
add regression test for #145529
lolbinarycat Aug 17, 2025
15a8999
refactor rustdoc::invalid_html_tags tag parser
lolbinarycat Aug 17, 2025
d022089
rustdoc::invalid_html_tags(unclosed comment): fix off by one in span
lolbinarycat Aug 19, 2025
10fde9e
Implement some more checks for `ptr_guaranteed_cmp` in consteval:
zachs18 Jul 28, 2025
25afbbc
Remove arm::t32-specific function pointer test.
zachs18 Aug 24, 2025
5d41f7c
Fix some minor issues in comments
houpo-bob Aug 24, 2025
46a7d28
Handle unwinding fatal errors in codegen workers
bjorn3 Aug 24, 2025
525c6a3
Directly raise fatal errors inside the codegen backends
bjorn3 Aug 24, 2025
9567812
compiletest: if a compiler fails outside a ui test, show its output
lolbinarycat Aug 24, 2025
a3229e4
Make `x test distcheck` more self-contained
Kobzol Aug 25, 2025
89f9cf3
Handle tarballs in `x test tidy`
Kobzol Aug 25, 2025
8fa5fc6
Do not forward CI configure arguments to `distcheck` builds
Kobzol Aug 25, 2025
2ea8621
Override `GITHUB_ACTIONS=0` for tidy tests
Kobzol Aug 25, 2025
d262463
Don't show warnings from xcrun with -Zverbose-internals
madsmtm Aug 25, 2025
cce9479
Wait for DPkg frontend lock when trying to remove packages
jieyouxu Aug 24, 2025
f43c6f9
Update books
rustbot Aug 25, 2025
85b5ec9
Update wasm-component-ld dependency
alexcrichton Aug 25, 2025
64cbe52
Allow linking a prebuilt optimized compiler-rt builtins library
Jun 24, 2025
148a07c
Refactor *.optimized-compiler-builtins bootstrap options
pmur Aug 20, 2025
2741508
Rollup merge of #143689 - pmur:murp/external-rt-optimized-compiler-bu…
Zalathar Aug 26, 2025
e011dd4
Rollup merge of #144885 - zachs18:ptr_guaranteed_cmp_more, r=RalfJung
Zalathar Aug 26, 2025
aecc028
Rollup merge of #145535 - lolbinarycat:rustdoc-invalid_html_tags-svg-…
Zalathar Aug 26, 2025
514d612
Rollup merge of #145766 - epage:rustfmt, r=calebcartwright
Zalathar Aug 26, 2025
67436ea
Rollup merge of #145811 - houpo-bob:master, r=samueltardieu
Zalathar Aug 26, 2025
f563309
Rollup merge of #145814 - bjorn3:codegen_worker_fatal_error, r=petroc…
Zalathar Aug 26, 2025
6c310ba
Rollup merge of #145815 - jieyouxu:pr-check-timeout, r=marcoieni
Zalathar Aug 26, 2025
cf0df73
Rollup merge of #145821 - lolbinarycat:compiletest-error-show, r=club…
Zalathar Aug 26, 2025
d196639
Rollup merge of #145845 - Kobzol:fix-distcheck, r=jieyouxu
Zalathar Aug 26, 2025
820bb7f
Rollup merge of #145847 - madsmtm:no-xcrun-warnings, r=jieyouxu
Zalathar Aug 26, 2025
05b34e8
Rollup merge of #145856 - rustbot:docs-update, r=ehuss
Zalathar Aug 26, 2025
a21c2a6
Rollup merge of #145858 - alexcrichton:update-wasm-component-ld, r=lqd
Zalathar Aug 26, 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
71 changes: 30 additions & 41 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5988,9 +5988,9 @@ dependencies = [

[[package]]
name = "wasi-preview1-component-adapter-provider"
version = "34.0.2"
version = "36.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "33696c5f1ff1e083de9f36c3da471abd736362bc173e093f8b0b1ed5a387e39b"
checksum = "20689c88791776219f78c2529700d15e6a9bd57a27858c62e9ef8487956b571c"

[[package]]
name = "wasm-bindgen"
Expand Down Expand Up @@ -6052,17 +6052,17 @@ dependencies = [

[[package]]
name = "wasm-component-ld"
version = "0.5.15"
version = "0.5.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6d95124e34fee1316222e03b9bbf41af186ecbae2c8b79f8debe6e21b3ff60c5"
checksum = "14cd35d6cae91109a0ffd207b573cf3c741cab7e921dd376ea7aaf2c52a3408c"
dependencies = [
"anyhow",
"clap",
"lexopt",
"libc",
"tempfile",
"wasi-preview1-component-adapter-provider",
"wasmparser 0.234.0",
"wasmparser 0.237.0",
"wat",
"windows-sys 0.59.0",
"winsplit",
Expand All @@ -6089,34 +6089,24 @@ dependencies = [

[[package]]
name = "wasm-encoder"
version = "0.234.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "170a0157eef517a179f2d20ed7c68df9c3f7f6c1c047782d488bf5a464174684"
dependencies = [
"leb128fmt",
"wasmparser 0.234.0",
]

[[package]]
name = "wasm-encoder"
version = "0.236.1"
version = "0.237.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "724fccfd4f3c24b7e589d333fc0429c68042897a7e8a5f8694f31792471841e7"
checksum = "efe92d1321afa53ffc88a57c497bb7330c3cf84c98ffdba4a4caf6a0684fad3c"
dependencies = [
"leb128fmt",
"wasmparser 0.236.1",
"wasmparser 0.237.0",
]

[[package]]
name = "wasm-metadata"
version = "0.234.0"
version = "0.237.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a42fe3f5cbfb56fc65311ef827930d06189160038e81db62188f66b4bf468e3a"
checksum = "4cc0b0a0c4f35ca6efa7a797671372915d4e9659dba2d59edc6fafc931d19997"
dependencies = [
"anyhow",
"indexmap",
"wasm-encoder 0.234.0",
"wasmparser 0.234.0",
"wasm-encoder 0.237.0",
"wasmparser 0.237.0",
]

[[package]]
Expand All @@ -6131,46 +6121,45 @@ dependencies = [

[[package]]
name = "wasmparser"
version = "0.234.0"
version = "0.236.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "be22e5a8f600afce671dd53c8d2dd26b4b7aa810fd18ae27dfc49737f3e02fc5"
checksum = "a9b1e81f3eb254cf7404a82cee6926a4a3ccc5aad80cc3d43608a070c67aa1d7"
dependencies = [
"bitflags",
"hashbrown",
"indexmap",
"semver",
"serde",
]

[[package]]
name = "wasmparser"
version = "0.236.1"
version = "0.237.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a9b1e81f3eb254cf7404a82cee6926a4a3ccc5aad80cc3d43608a070c67aa1d7"
checksum = "7d2a40ca0d2bdf4b0bf36c13a737d0b2c58e4c8aaefe1c57f336dd75369ca250"
dependencies = [
"bitflags",
"hashbrown",
"indexmap",
"semver",
"serde",
]

[[package]]
name = "wast"
version = "236.0.1"
version = "237.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d3bec4b4db9c6808d394632fd4b0cd4654c32c540bd3237f55ee6a40fff6e51f"
checksum = "fcf66f545acbd55082485cb9a6daab54579cb8628a027162253e8e9f5963c767"
dependencies = [
"bumpalo",
"leb128fmt",
"memchr",
"unicode-width 0.2.1",
"wasm-encoder 0.236.1",
"wasm-encoder 0.237.0",
]

[[package]]
name = "wat"
version = "1.236.1"
version = "1.237.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "64475e2f77d6071ce90624098fc236285ddafa8c3ea1fb386f2c4154b6c2bbdb"
checksum = "27975186f549e4b8d6878b627be732863883c72f7bf4dcf8f96e5f8242f73da9"
dependencies = [
"wast",
]
Expand Down Expand Up @@ -6659,9 +6648,9 @@ dependencies = [

[[package]]
name = "wit-component"
version = "0.234.0"
version = "0.237.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5a8888169acf4c6c4db535beb405b570eedac13215d6821ca9bd03190f7f8b8c"
checksum = "bfb7674f76c10e82fe00b256a9d4ffb2b8d037d42ab8e9a83ebb3be35c9d0bf6"
dependencies = [
"anyhow",
"bitflags",
Expand All @@ -6670,17 +6659,17 @@ dependencies = [
"serde",
"serde_derive",
"serde_json",
"wasm-encoder 0.234.0",
"wasm-encoder 0.237.0",
"wasm-metadata",
"wasmparser 0.234.0",
"wasmparser 0.237.0",
"wit-parser",
]

[[package]]
name = "wit-parser"
version = "0.234.0"
version = "0.237.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "465492df47d8dcc015a3b7f241aed8ea03688fee7c5e04162285c5b1a3539c8b"
checksum = "ce2596a5bc7c24cc965b56ad6ff9e32394c4e401764f89620a888519c6e849ab"
dependencies = [
"anyhow",
"id-arena",
Expand All @@ -6691,7 +6680,7 @@ dependencies = [
"serde_derive",
"serde_json",
"unicode-xid",
"wasmparser 0.234.0",
"wasmparser 0.237.0",
]

[[package]]
Expand Down
17 changes: 11 additions & 6 deletions bootstrap.example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -407,8 +407,11 @@
#build.profiler = false

# Use the optimized LLVM C intrinsics for `compiler_builtins`, rather than Rust intrinsics.
# Requires the LLVM submodule to be managed by bootstrap (i.e. not external) so that `compiler-rt`
# sources are available.
# Choosing true requires the LLVM submodule to be managed by bootstrap (i.e. not external)
# so that `compiler-rt` sources are available.
#
# Setting this to a path removes the requirement for a C toolchain, but requires setting the
# path to an existing library containing the builtins library from LLVM's compiler-rt.
#
# Setting this to `false` generates slower code, but removes the requirement for a C toolchain in
# order to run `x check`.
Expand Down Expand Up @@ -1041,13 +1044,15 @@
#runner = <none> (string)

# Use the optimized LLVM C intrinsics for `compiler_builtins`, rather than Rust intrinsics
# on this target.
# Requires the LLVM submodule to be managed by bootstrap (i.e. not external) so that `compiler-rt`
# sources are available.
# on this target. Choosing true requires the LLVM submodule to be managed by bootstrap
# (i.e. not external) so that `compiler-rt` sources are available.
#
# Setting this to a path removes the requirement for a C toolchain, but requires setting the
# path to an existing library containing the builtins library from LLVM's compiler-rt.
#
# Setting this to `false` generates slower code, but removes the requirement for a C toolchain in
# order to run `x check`.
#optimized-compiler-builtins = build.optimized-compiler-builtins (bool)
#optimized-compiler-builtins = build.optimized-compiler-builtins (bool or path)

# Link the compiler and LLVM against `jemalloc` instead of the default libc allocator.
# This overrides the global `rust.jemalloc` option. See that option for more info.
Expand Down
33 changes: 16 additions & 17 deletions compiler/rustc_codegen_gcc/src/back/lto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ use rustc_codegen_ssa::back::write::{CodegenContext, FatLtoInput};
use rustc_codegen_ssa::traits::*;
use rustc_codegen_ssa::{ModuleCodegen, ModuleKind, looks_like_rust_object_file};
use rustc_data_structures::memmap::Mmap;
use rustc_errors::{DiagCtxtHandle, FatalError};
use rustc_errors::DiagCtxtHandle;
use rustc_middle::bug;
use rustc_middle::dep_graph::WorkProduct;
use rustc_session::config::Lto;
Expand All @@ -51,12 +51,11 @@ fn prepare_lto(
cgcx: &CodegenContext<GccCodegenBackend>,
each_linked_rlib_for_lto: &[PathBuf],
dcx: DiagCtxtHandle<'_>,
) -> Result<LtoData, FatalError> {
) -> LtoData {
let tmp_path = match tempdir() {
Ok(tmp_path) => tmp_path,
Err(error) => {
eprintln!("Cannot create temporary directory: {}", error);
return Err(FatalError);
dcx.fatal(format!("Cannot create temporary directory: {}", error));
}
};

Expand Down Expand Up @@ -91,15 +90,14 @@ fn prepare_lto(
upstream_modules.push((module, CString::new(name).unwrap()));
}
Err(e) => {
dcx.emit_err(e);
return Err(FatalError);
dcx.emit_fatal(e);
}
}
}
}
}

Ok(LtoData { upstream_modules, tmp_path })
LtoData { upstream_modules, tmp_path }
}

fn save_as_file(obj: &[u8], path: &Path) -> Result<(), LtoBitcodeFromRlib> {
Expand All @@ -114,10 +112,10 @@ pub(crate) fn run_fat(
cgcx: &CodegenContext<GccCodegenBackend>,
each_linked_rlib_for_lto: &[PathBuf],
modules: Vec<FatLtoInput<GccCodegenBackend>>,
) -> Result<ModuleCodegen<GccContext>, FatalError> {
) -> ModuleCodegen<GccContext> {
let dcx = cgcx.create_dcx();
let dcx = dcx.handle();
let lto_data = prepare_lto(cgcx, each_linked_rlib_for_lto, dcx)?;
let lto_data = prepare_lto(cgcx, each_linked_rlib_for_lto, dcx);
/*let symbols_below_threshold =
lto_data.symbols_below_threshold.iter().map(|c| c.as_ptr()).collect::<Vec<_>>();*/
fat_lto(
Expand All @@ -137,7 +135,7 @@ fn fat_lto(
mut serialized_modules: Vec<(SerializedModule<ModuleBuffer>, CString)>,
tmp_path: TempDir,
//symbols_below_threshold: &[String],
) -> Result<ModuleCodegen<GccContext>, FatalError> {
) -> ModuleCodegen<GccContext> {
let _timer = cgcx.prof.generic_activity("GCC_fat_lto_build_monolithic_module");
info!("going for a fat lto");

Expand Down Expand Up @@ -261,7 +259,7 @@ fn fat_lto(
// of now.
module.module_llvm.temp_dir = Some(tmp_path);

Ok(module)
module
}

pub struct ModuleBuffer(PathBuf);
Expand All @@ -286,10 +284,10 @@ pub(crate) fn run_thin(
each_linked_rlib_for_lto: &[PathBuf],
modules: Vec<(String, ThinBuffer)>,
cached_modules: Vec<(SerializedModule<ModuleBuffer>, WorkProduct)>,
) -> Result<(Vec<ThinModule<GccCodegenBackend>>, Vec<WorkProduct>), FatalError> {
) -> (Vec<ThinModule<GccCodegenBackend>>, Vec<WorkProduct>) {
let dcx = cgcx.create_dcx();
let dcx = dcx.handle();
let lto_data = prepare_lto(cgcx, each_linked_rlib_for_lto, dcx)?;
let lto_data = prepare_lto(cgcx, each_linked_rlib_for_lto, dcx);
if cgcx.opts.cg.linker_plugin_lto.enabled() {
unreachable!(
"We should never reach this case if the LTO step \
Expand Down Expand Up @@ -355,7 +353,7 @@ fn thin_lto(
tmp_path: TempDir,
cached_modules: Vec<(SerializedModule<ModuleBuffer>, WorkProduct)>,
//_symbols_below_threshold: &[String],
) -> Result<(Vec<ThinModule<GccCodegenBackend>>, Vec<WorkProduct>), FatalError> {
) -> (Vec<ThinModule<GccCodegenBackend>>, Vec<WorkProduct>) {
let _timer = cgcx.prof.generic_activity("LLVM_thin_lto_global_analysis");
info!("going for that thin, thin LTO");

Expand Down Expand Up @@ -518,13 +516,13 @@ fn thin_lto(
// TODO: save the directory so that it gets deleted later.
std::mem::forget(tmp_path);

Ok((opt_jobs, copy_jobs))
(opt_jobs, copy_jobs)
}

pub fn optimize_thin_module(
thin_module: ThinModule<GccCodegenBackend>,
_cgcx: &CodegenContext<GccCodegenBackend>,
) -> Result<ModuleCodegen<GccContext>, FatalError> {
) -> ModuleCodegen<GccContext> {
//let dcx = cgcx.create_dcx();

//let module_name = &thin_module.shared.module_names[thin_module.idx];
Expand Down Expand Up @@ -634,7 +632,8 @@ pub fn optimize_thin_module(
save_temp_bitcode(cgcx, &module, "thin-lto-after-pm");
}
}*/
Ok(module)
#[allow(clippy::let_and_return)]
module
}

pub struct ThinBuffer {
Expand Down
7 changes: 3 additions & 4 deletions compiler/rustc_codegen_gcc/src/back/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ use rustc_codegen_ssa::back::write::{BitcodeSection, CodegenContext, EmitObj, Mo
use rustc_codegen_ssa::{CompiledModule, ModuleCodegen};
use rustc_fs_util::link_or_copy;
use rustc_session::config::OutputType;
use rustc_span::fatal_error::FatalError;
use rustc_target::spec::SplitDebuginfo;

use crate::base::add_pic_option;
Expand All @@ -17,7 +16,7 @@ pub(crate) fn codegen(
cgcx: &CodegenContext<GccCodegenBackend>,
module: ModuleCodegen<GccContext>,
config: &ModuleConfig,
) -> Result<CompiledModule, FatalError> {
) -> CompiledModule {
let dcx = cgcx.create_dcx();
let dcx = dcx.handle();

Expand Down Expand Up @@ -246,15 +245,15 @@ pub(crate) fn codegen(
}
}

Ok(module.into_compiled_module(
module.into_compiled_module(
config.emit_obj != EmitObj::None,
cgcx.target_can_use_split_dwarf && cgcx.split_debuginfo == SplitDebuginfo::Unpacked,
config.emit_bc,
config.emit_asm,
config.emit_ir,
&cgcx.output_filenames,
cgcx.invocation_temp.as_deref(),
))
)
}

pub(crate) fn save_temp_bitcode(
Expand Down
Loading
Loading