Auto merge of #2236 - RalfJung:rustup, r=RalfJung

rustup

I feel like tests became a *lot* slower. I am not sure what is going on and don't have time to debug right now.
This commit is contained in:
bors 2022-06-16 18:18:39 +00:00
commit ab6f509ba7
5 changed files with 19 additions and 8 deletions

View File

@ -1 +1 @@
546c826f0ccaab36e897860205281f490db274e6
1f34da9ec8a85b6f86c5fa1c121ab6f88f2f4966

View File

@ -1,4 +1,5 @@
// compile-flags: -Zmiri-disable-isolation
// We want to control preemption here.
// compile-flags: -Zmiri-disable-isolation -Zmiri-preemption-rate=0
// ignore-windows: Concurrency on Windows is not supported yet.
use std::sync::Arc;
use std::sync::atomic::{AtomicUsize, Ordering, fence};

View File

@ -6,11 +6,11 @@ LL | const VOID: ! = panic!();
|
= note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info)
error: post-monomorphization error: encountered constants with type errors, stopping evaluation
error: post-monomorphization error: referenced constant has errors
--> $DIR/erroneous_const.rs:LL:CC
|
LL | let _ = PrintName::<T>::VOID;
| ^^^^^^^^^^^^^^^^^^^^ encountered constants with type errors, stopping evaluation
| ^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
|
= note: inside `no_codegen::<i32>` at $DIR/erroneous_const.rs:LL:CC
note: inside `main` at $DIR/erroneous_const.rs:LL:CC

View File

@ -9,20 +9,23 @@ use std::thread;
/// The test taken from the Rust documentation.
fn simple_send() {
let (tx, rx) = channel();
thread::spawn(move || {
let t = thread::spawn(move || {
tx.send(10).unwrap();
});
assert_eq!(rx.recv().unwrap(), 10);
t.join().unwrap();
}
/// The test taken from the Rust documentation.
fn multiple_send() {
let (tx, rx) = channel();
let mut threads = vec![];
for i in 0..10 {
let tx = tx.clone();
thread::spawn(move || {
let t = thread::spawn(move || {
tx.send(i).unwrap();
});
threads.push(t);
}
let mut sum = 0;
@ -32,6 +35,10 @@ fn multiple_send() {
sum += j;
}
assert_eq!(sum, 45);
for t in threads {
t.join().unwrap();
}
}
/// The test taken from the Rust documentation.
@ -41,13 +48,15 @@ fn send_on_sync() {
// this returns immediately
sender.send(1).unwrap();
thread::spawn(move || {
let t = thread::spawn(move || {
// this will block until the previous message has been received
sender.send(2).unwrap();
});
assert_eq!(receiver.recv().unwrap(), 1);
assert_eq!(receiver.recv().unwrap(), 2);
t.join().unwrap();
}
fn main() {

View File

@ -1,5 +1,6 @@
// ignore-windows: Concurrency on Windows is not supported yet.
// compile-flags: -Zmiri-ignore-leaks
// FIXME: disallow preemption to work around https://github.com/rust-lang/rust/issues/55005
// compile-flags: -Zmiri-ignore-leaks -Zmiri-preemption-rate=0
//! Test that leaking threads works, and that their destructors are not executed.