Merge from rustc

This commit is contained in:
The Miri Cronjob Bot 2025-06-29 05:06:26 +00:00
commit 7b985d5435
66 changed files with 1363 additions and 273 deletions

View file

@ -10,4 +10,7 @@ python3 ../x.py build --set rust.debug=true opt-dist
build-manifest bootstrap
# Use GCC for building GCC, as it seems to behave badly when built with Clang
CC=/rustroot/bin/cc CXX=/rustroot/bin/c++ python3 ../x.py dist gcc
# Only build GCC on full builds, not try builds
if [ "${DIST_TRY_BUILD:-0}" == "0" ]; then
CC=/rustroot/bin/cc CXX=/rustroot/bin/c++ python3 ../x.py dist gcc
fi

View file

@ -1703,6 +1703,7 @@ fn render_enum_fields(
if v.is_stripped() {
continue;
}
write!(w, "{}", render_attributes_in_pre(v, TAB, cx))?;
w.write_str(TAB)?;
match v.kind {
clean::VariantItem(ref var) => match var.kind {

View file

@ -14,6 +14,7 @@ use crate::versions::{PkgType, Versions};
static HOSTS: &[&str] = &[
"aarch64-apple-darwin",
"aarch64-pc-windows-gnullvm",
"aarch64-pc-windows-msvc",
"aarch64-unknown-linux-gnu",
"aarch64-unknown-linux-musl",
@ -44,6 +45,7 @@ static HOSTS: &[&str] = &[
"x86_64-apple-darwin",
"x86_64-pc-solaris",
"x86_64-pc-windows-gnu",
"x86_64-pc-windows-gnullvm",
"x86_64-pc-windows-msvc",
"x86_64-unknown-freebsd",
"x86_64-unknown-illumos",
@ -470,7 +472,7 @@ impl Builder {
}
// so is rust-mingw if it's available for the target
PkgType::RustMingw => {
if host.contains("pc-windows-gnu") {
if host.ends_with("pc-windows-gnu") {
components.push(host_component(pkg));
}
}

@ -1 +1 @@
Subproject commit 409fed7dc1553d49cb9a8c0637d12d65571346ce
Subproject commit 930b4f62cfcd1f0eabdb30a56d91bf6844b739bf

View file

@ -595,7 +595,7 @@ Definite bugs found:
* [Occasional memory leak in `std::mpsc` channels](https://github.com/rust-lang/rust/issues/121582) (original code in [crossbeam](https://github.com/crossbeam-rs/crossbeam/pull/1084))
* [Weak-memory-induced memory leak in Windows thread-local storage](https://github.com/rust-lang/rust/pull/124281)
* [A bug in the new `RwLock::downgrade` implementation](https://rust-lang.zulipchat.com/#narrow/channel/269128-miri/topic/Miri.20error.20library.20test) (caught by Miri before it landed in the Rust repo)
* [Mockall reading unintialized memory when mocking `std::io::Read::read`, even if all expectations are satisfied](https://github.com/asomers/mockall/issues/647) (caught by Miri running Tokio's test suite)
* [Mockall reading uninitialized memory when mocking `std::io::Read::read`, even if all expectations are satisfied](https://github.com/asomers/mockall/issues/647) (caught by Miri running Tokio's test suite)
* [`ReentrantLock` not correctly dealing with reuse of addresses for TLS storage of different threads](https://github.com/rust-lang/rust/pull/141248)
Violations of [Stacked Borrows] found that are likely bugs (but Stacked Borrows is currently just an experiment):

View file

@ -173,7 +173,7 @@ pub const MIRI_DEFAULT_ARGS: &[&str] = &[
"-Zmir-emit-retag",
"-Zmir-preserve-ub",
"-Zmir-opt-level=0",
"-Zmir-enable-passes=-CheckAlignment,-CheckNull",
"-Zmir-enable-passes=-CheckAlignment,-CheckNull,-CheckEnums",
// Deduplicating diagnostics means we miss events when tracking what happens during an
// execution. Let's not do that.
"-Zdeduplicate-diagnostics=no",

View file

@ -6,7 +6,7 @@ fn direct_raw(x: *const (i32, i32)) -> *const i32 {
// Ensure that if a raw pointer is created via an intermediate
// reference, we catch that. (Just in case someone decides to
// desugar this differenly or so.)
// desugar this differently or so.)
fn via_ref(x: *const (i32, i32)) -> *const i32 {
unsafe { &(*x).0 as *const i32 } //~ERROR: dangling pointer
}

View file

@ -122,7 +122,12 @@ impl Bootstrap {
let metrics_path = env.build_root().join("build").join("metrics.json");
let args = dist_args.iter().map(|arg| arg.as_str()).collect::<Vec<_>>();
let cmd = cmd(&args).env("RUST_BACKTRACE", "full");
let cmd = add_shared_x_flags(env, cmd);
let mut cmd = add_shared_x_flags(env, cmd);
if env.is_fast_try_build() {
// We set build.extended=false for fast try builds, but we still need Cargo
cmd = cmd.arg("cargo");
}
Self { cmd, metrics_path }
}
@ -189,5 +194,18 @@ impl Bootstrap {
}
fn add_shared_x_flags(env: &Environment, cmd: CmdBuilder) -> CmdBuilder {
if env.is_fast_try_build() { cmd.arg("--set").arg("rust.deny-warnings=false") } else { cmd }
if env.is_fast_try_build() {
// Skip things that cannot be skipped through `x ... --skip`
cmd.arg("--set")
.arg("rust.llvm-bitcode-linker=false")
// Skip wasm-component-ld. This also skips cargo, which we need to re-enable for dist
.arg("--set")
.arg("build.extended=false")
.arg("--set")
.arg("rust.codegen-backends=['llvm']")
.arg("--set")
.arg("rust.deny-warnings=false")
} else {
cmd
}
}

View file

@ -407,13 +407,18 @@ fn main() -> anyhow::Result<()> {
for target in [
"rust-docs",
"rustc-docs",
"rustc-dev",
"rust-dev",
"rust-docs-json",
"rust-analyzer",
"rustc-src",
"extended",
"clippy",
"miri",
"rustfmt",
"gcc",
"generate-copyright",
"bootstrap",
] {
build_args.extend(["--skip".to_string(), target.to_string()]);
}

View file

@ -118,7 +118,7 @@ pub fn finish_all(tests: &[TestInfo], total_elapsed: Duration, cfg: &Config) ->
match result {
Ok(FinishedAll) => (),
Err(EarlyExit::Timeout) => {
println!(" exited early; exceded {:?} timeout", cfg.timeout)
println!(" exited early; exceeded {:?} timeout", cfg.timeout)
}
Err(EarlyExit::MaxFailures) => {
println!(" exited early; exceeded {:?} max failures", cfg.max_failures)