Auto merge of #136110 - RalfJung:miri-sync, r=RalfJung
Miri subtree update r? `@ghost`
This commit is contained in:
commit
2f348cb7ce
9 changed files with 22 additions and 16 deletions
|
|
@ -14,7 +14,9 @@ function endgroup {
|
|||
begingroup "Building Miri"
|
||||
|
||||
# Global configuration
|
||||
export RUSTFLAGS="-D warnings"
|
||||
# We are getting some odd linker warnings on macOS, make sure they do not fail the build.
|
||||
# (See <https://github.com/rust-lang/rust/issues/136086>.)
|
||||
export RUSTFLAGS="-D warnings -A linker-messages"
|
||||
export CARGO_INCREMENTAL=0
|
||||
export CARGO_EXTRA_FLAGS="--locked"
|
||||
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
01706e1a34c87656fcbfce198608f4cd2ac6461a
|
||||
2f0ad2a71e4a4528bb80bcb24bf8fa4e50cb87c2
|
||||
|
|
|
|||
|
|
@ -29,11 +29,12 @@ use std::num::NonZero;
|
|||
use std::ops::Range;
|
||||
use std::path::PathBuf;
|
||||
use std::str::FromStr;
|
||||
use std::sync::atomic::{AtomicI32, Ordering};
|
||||
use std::sync::Once;
|
||||
use std::sync::atomic::{AtomicI32, AtomicU32, Ordering};
|
||||
|
||||
use miri::{
|
||||
BacktraceStyle, BorrowTrackerMethod, MiriConfig, MiriEntryFnType,ProvenanceMode, RetagFields, ValidationMode,
|
||||
BacktraceStyle, BorrowTrackerMethod, MiriConfig, MiriEntryFnType, ProvenanceMode, RetagFields,
|
||||
ValidationMode,
|
||||
};
|
||||
use rustc_abi::ExternAbi;
|
||||
use rustc_data_structures::sync;
|
||||
|
|
@ -182,7 +183,8 @@ impl rustc_driver::Callbacks for MiriCompilerCalls {
|
|||
if let Some(many_seeds) = self.many_seeds.take() {
|
||||
assert!(config.seed.is_none());
|
||||
let exit_code = sync::IntoDynSyncSend(AtomicI32::new(rustc_driver::EXIT_SUCCESS));
|
||||
sync::par_for_each_in(many_seeds.seeds, |seed| {
|
||||
let num_failed = sync::IntoDynSyncSend(AtomicU32::new(0));
|
||||
sync::par_for_each_in(many_seeds.seeds.clone(), |seed| {
|
||||
let mut config = config.clone();
|
||||
config.seed = Some(seed.into());
|
||||
eprintln!("Trying seed: {seed}");
|
||||
|
|
@ -196,8 +198,13 @@ impl rustc_driver::Callbacks for MiriCompilerCalls {
|
|||
std::process::exit(return_code);
|
||||
}
|
||||
exit_code.store(return_code, Ordering::Relaxed);
|
||||
num_failed.fetch_add(1, Ordering::Relaxed);
|
||||
}
|
||||
});
|
||||
let num_failed = num_failed.0.into_inner();
|
||||
if num_failed > 0 {
|
||||
eprintln!("{num_failed}/{total} SEEDS FAILED", total = many_seeds.seeds.count());
|
||||
}
|
||||
std::process::exit(exit_code.0.into_inner());
|
||||
} else {
|
||||
let return_code = miri::eval_entry(tcx, entry_def_id, entry_type, config)
|
||||
|
|
@ -716,10 +723,9 @@ fn main() {
|
|||
|
||||
// Ensure we have parallelism for many-seeds mode.
|
||||
if many_seeds.is_some() && !rustc_args.iter().any(|arg| arg.starts_with("-Zthreads=")) {
|
||||
rustc_args.push(format!(
|
||||
"-Zthreads={}",
|
||||
std::thread::available_parallelism().map_or(1, |n| n.get())
|
||||
));
|
||||
// Clamp to 8 threads; things get a lot less efficient beyond that due to lock contention.
|
||||
let threads = std::thread::available_parallelism().map_or(1, |n| n.get()).min(8);
|
||||
rustc_args.push(format!("-Zthreads={threads}"));
|
||||
}
|
||||
let many_seeds =
|
||||
many_seeds.map(|seeds| ManySeedsConfig { seeds, keep_going: many_seeds_keep_going });
|
||||
|
|
|
|||
|
|
@ -38,9 +38,10 @@ fn try_resolve_did(tcx: TyCtxt<'_>, path: &[&str], namespace: Option<Namespace>)
|
|||
item: DefId,
|
||||
name: &'a str,
|
||||
) -> impl Iterator<Item = DefId> + 'a {
|
||||
let name = Symbol::intern(name);
|
||||
tcx.module_children(item)
|
||||
.iter()
|
||||
.filter(move |item| item.ident.name.as_str() == name)
|
||||
.filter(move |item| item.ident.name == name)
|
||||
.map(move |item| item.res.def_id())
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
// Copied from tests/pass/no-std.rs
|
||||
|
||||
#![no_std]
|
||||
#![no_main]
|
||||
|
||||
// Plumbing to let us use `writeln!` to host stdout:
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
#![feature(intrinsics)]
|
||||
|
||||
mod rusti {
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@
|
|||
#[rustc_intrinsic]
|
||||
unsafe fn float_to_int_unchecked<Float: Copy, Int: Copy>(_value: Float) -> Int;
|
||||
|
||||
|
||||
fn main() {
|
||||
unsafe {
|
||||
float_to_int_unchecked::<f32, u32>(-f32::NAN); //~ ERROR: cannot be represented in target type `u32`
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@
|
|||
#[rustc_intrinsic]
|
||||
unsafe fn float_to_int_unchecked<Float: Copy, Int: Copy>(_value: Float) -> Int;
|
||||
|
||||
|
||||
fn main() {
|
||||
unsafe {
|
||||
float_to_int_unchecked::<f64, u128>(f64::NEG_INFINITY); //~ ERROR: cannot be represented in target type `u128`
|
||||
|
|
|
|||
|
|
@ -235,7 +235,7 @@ fn concurrent_wait_wake() {
|
|||
static mut DATA: i32 = 0;
|
||||
static WOKEN: AtomicI32 = AtomicI32::new(0);
|
||||
|
||||
let rounds = 50;
|
||||
let rounds = 64;
|
||||
for _ in 0..rounds {
|
||||
unsafe { DATA = 0 }; // Reset
|
||||
// Suppose the main thread is holding a lock implemented using futex...
|
||||
|
|
@ -267,8 +267,7 @@ fn concurrent_wait_wake() {
|
|||
}
|
||||
});
|
||||
// Increase the chance that the other thread actually goes to sleep.
|
||||
// (5 yields in a loop seem to make that happen around 40% of the time.)
|
||||
for _ in 0..5 {
|
||||
for _ in 0..6 {
|
||||
thread::yield_now();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue