Skip to content

rustup #2236

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 16, 2022
Merged

rustup #2236

Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion rust-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
546c826f0ccaab36e897860205281f490db274e6
1f34da9ec8a85b6f86c5fa1c121ab6f88f2f4966
3 changes: 2 additions & 1 deletion tests/fail/data_race/fence_after_load.rs
Original file line number Diff line number Diff line change
@@ -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};
Expand Down
4 changes: 2 additions & 2 deletions tests/fail/erroneous_const.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 12 additions & 3 deletions tests/pass/concurrency/channels.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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.
Expand All @@ -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() {
Expand Down
3 changes: 2 additions & 1 deletion tests/pass/threadleak_ignored.rs
Original file line number Diff line number Diff line change
@@ -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.

Expand Down