Skip to content

Commit

Permalink
Auto merge of #1729 - RalfJung:rustup, r=RalfJung
Browse files Browse the repository at this point in the history
rustup; fix tests for new MIR optimization

Somehow rust-lang/rust#78360 manages to mask UB. This would make sense if there were loops or things like that, but there are not, so really this is just very confusing...
  • Loading branch information
bors committed Mar 2, 2021
2 parents 46a08b7 + 2ef3338 commit f440288
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 114 deletions.
2 changes: 1 addition & 1 deletion rust-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
d2731d8e9338d8fe844e19d3fbb39617753e65f4
09db05762b283bed62d4f92729cfee4646519833
8 changes: 4 additions & 4 deletions tests/compile-fail/data_race/dealloc_read_race_stack.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-disable-isolation
// compile-flags: -Zmiri-disable-isolation -Zmir-opt-level=0
// FIXME: Disabling optimizations since somehow #78360 broke this test.

use std::thread::{spawn, sleep};
use std::ptr::null_mut;
Expand Down Expand Up @@ -27,9 +28,6 @@ pub fn main() {
// 3. stack-deallocate
unsafe {
let j1 = spawn(move || {
// Concurrent allocate the memory.
// Uses relaxed semantics to not generate
// a release sequence.
let pointer = &*ptr.0;
{
let mut stack_var = 0usize;
Expand All @@ -38,6 +36,8 @@ pub fn main() {

sleep(Duration::from_millis(200));

// Now `stack_var` gets deallocated.

} //~ ERROR Data race detected between Deallocate on Thread(id = 1) and Read on Thread(id = 2)
});

Expand Down
52 changes: 0 additions & 52 deletions tests/compile-fail/data_race/dealloc_read_race_stack_drop.rs

This file was deleted.

8 changes: 4 additions & 4 deletions tests/compile-fail/data_race/dealloc_write_race_stack.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-disable-isolation
// compile-flags: -Zmiri-disable-isolation -Zmir-opt-level=0
// FIXME: Disabling optimizations since somehow #78360 broke this test.

use std::thread::{spawn, sleep};
use std::ptr::null_mut;
Expand Down Expand Up @@ -27,9 +28,6 @@ pub fn main() {
// 3. stack-deallocate
unsafe {
let j1 = spawn(move || {
// Concurrent allocate the memory.
// Uses relaxed semantics to not generate
// a release sequence.
let pointer = &*ptr.0;
{
let mut stack_var = 0usize;
Expand All @@ -38,6 +36,8 @@ pub fn main() {

sleep(Duration::from_millis(200));

// Now `stack_var` gets deallocated.

} //~ ERROR Data race detected between Deallocate on Thread(id = 1) and Write on Thread(id = 2)
});

Expand Down
53 changes: 0 additions & 53 deletions tests/compile-fail/data_race/dealloc_write_race_stack_drop.rs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// ignore-windows: No libc on Windows
// compile-flags: -Zmir-opt-level=0
// FIXME: Disabling optimizations since somehow #78360 broke this test.

#![feature(rustc_private)]

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// ignore-windows: No libc on Windows
// compile-flags: -Zmir-opt-level=0
// FIXME: Disabling optimizations since somehow #78360 broke this test.

#![feature(rustc_private)]

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// ignore-windows: No libc on Windows
// compile-flags: -Zmir-opt-level=0
// FIXME: Disabling optimizations since somehow #78360 broke this test.

#![feature(rustc_private)]

Expand Down

0 comments on commit f440288

Please sign in to comment.