Skip to content

Commit f4165be

Browse files
committed
Add a (1) and (2) to the data race errors
1 parent a2e09ba commit f4165be

File tree

57 files changed

+113
-113
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+113
-113
lines changed

src/tools/miri/src/diagnostics.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ impl fmt::Display for TerminationInfo {
6969
DataRace { ptr, op1, op2 } =>
7070
write!(
7171
f,
72-
"Data race detected between {} on {} and {} on {} at {:?}. The {} is here",
73-
op1.action, op1.thread_info, op2.action, op2.thread_info, ptr, op1.action
72+
"Data race detected between (1) {} on {} and (2) {} on {} at {ptr:?}. (1) just happened here",
73+
op1.action, op1.thread_info, op2.action, op2.thread_info
7474
),
7575
}
7676
}
@@ -224,7 +224,7 @@ pub fn report_error<'tcx, 'mir>(
224224
vec![(None, format!("use Strict Provenance APIs (https://doc.rust-lang.org/nightly/std/ptr/index.html#strict-provenance, https://crates.io/crates/sptr) instead"))],
225225
DataRace { op2, .. } =>
226226
vec![
227-
(Some(op2.span), format!("and the {} on {} is here", op2.action, op2.thread_info)),
227+
(Some(op2.span), format!("and (2) occurred earlier here")),
228228
(None, format!("this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior")),
229229
(None, format!("see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information")),
230230
],

src/tools/miri/tests/fail/data_race/alloc_read_race.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ pub fn main() {
3737
let pointer = &*ptr.0;
3838

3939
// Note: could also error due to reading uninitialized memory, but the data-race detector triggers first.
40-
*pointer.load(Ordering::Relaxed) //~ ERROR: Data race detected between Read on thread `<unnamed>` and Allocate on thread `<unnamed>`
40+
*pointer.load(Ordering::Relaxed) //~ ERROR: Data race detected between (1) Read on thread `<unnamed>` and (2) Allocate on thread `<unnamed>`
4141
});
4242

4343
j1.join().unwrap();

src/tools/miri/tests/fail/data_race/alloc_read_race.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
error: Undefined Behavior: Data race detected between Read on thread `<unnamed>` and Allocate on thread `<unnamed>` at ALLOC. The Read is here
1+
error: Undefined Behavior: Data race detected between (1) Read on thread `<unnamed>` and (2) Allocate on thread `<unnamed>` at ALLOC. (1) just happened here
22
--> $DIR/alloc_read_race.rs:LL:CC
33
|
44
LL | *pointer.load(Ordering::Relaxed)
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Data race detected between Read on thread `<unnamed>` and Allocate on thread `<unnamed>` at ALLOC. The Read is here
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Data race detected between (1) Read on thread `<unnamed>` and (2) Allocate on thread `<unnamed>` at ALLOC. (1) just happened here
66
|
7-
help: and the Allocate on thread `<unnamed>` is here
7+
help: and (2) occurred earlier here
88
--> $DIR/alloc_read_race.rs:LL:CC
99
|
1010
LL | pointer.store(Box::into_raw(Box::new_uninit()), Ordering::Relaxed);

src/tools/miri/tests/fail/data_race/alloc_write_race.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ pub fn main() {
3535

3636
let j2 = spawn(move || {
3737
let pointer = &*ptr.0;
38-
*pointer.load(Ordering::Relaxed) = 2; //~ ERROR: Data race detected between Write on thread `<unnamed>` and Allocate on thread `<unnamed>`
38+
*pointer.load(Ordering::Relaxed) = 2; //~ ERROR: Data race detected between (1) Write on thread `<unnamed>` and (2) Allocate on thread `<unnamed>`
3939
});
4040

4141
j1.join().unwrap();

src/tools/miri/tests/fail/data_race/alloc_write_race.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
error: Undefined Behavior: Data race detected between Write on thread `<unnamed>` and Allocate on thread `<unnamed>` at ALLOC. The Write is here
1+
error: Undefined Behavior: Data race detected between (1) Write on thread `<unnamed>` and (2) Allocate on thread `<unnamed>` at ALLOC. (1) just happened here
22
--> $DIR/alloc_write_race.rs:LL:CC
33
|
44
LL | *pointer.load(Ordering::Relaxed) = 2;
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Data race detected between Write on thread `<unnamed>` and Allocate on thread `<unnamed>` at ALLOC. The Write is here
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Data race detected between (1) Write on thread `<unnamed>` and (2) Allocate on thread `<unnamed>` at ALLOC. (1) just happened here
66
|
7-
help: and the Allocate on thread `<unnamed>` is here
7+
help: and (2) occurred earlier here
88
--> $DIR/alloc_write_race.rs:LL:CC
99
|
1010
LL | .store(Box::into_raw(Box::<usize>::new_uninit()) as *mut usize, Ordering::Relaxed);

src/tools/miri/tests/fail/data_race/atomic_read_na_write_race1.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ pub fn main() {
2020
});
2121

2222
let j2 = spawn(move || {
23-
(&*c.0).load(Ordering::SeqCst) //~ ERROR: Data race detected between Atomic Load on thread `<unnamed>` and Write on thread `<unnamed>`
23+
(&*c.0).load(Ordering::SeqCst) //~ ERROR: Data race detected between (1) Atomic Load on thread `<unnamed>` and (2) Write on thread `<unnamed>`
2424
});
2525

2626
j1.join().unwrap();

src/tools/miri/tests/fail/data_race/atomic_read_na_write_race1.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
error: Undefined Behavior: Data race detected between Atomic Load on thread `<unnamed>` and Write on thread `<unnamed>` at ALLOC. The Atomic Load is here
1+
error: Undefined Behavior: Data race detected between (1) Atomic Load on thread `<unnamed>` and (2) Write on thread `<unnamed>` at ALLOC. (1) just happened here
22
--> $DIR/atomic_read_na_write_race1.rs:LL:CC
33
|
44
LL | (&*c.0).load(Ordering::SeqCst)
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Data race detected between Atomic Load on thread `<unnamed>` and Write on thread `<unnamed>` at ALLOC. The Atomic Load is here
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Data race detected between (1) Atomic Load on thread `<unnamed>` and (2) Write on thread `<unnamed>` at ALLOC. (1) just happened here
66
|
7-
help: and the Write on thread `<unnamed>` is here
7+
help: and (2) occurred earlier here
88
--> $DIR/atomic_read_na_write_race1.rs:LL:CC
99
|
1010
LL | *(c.0 as *mut usize) = 32;

src/tools/miri/tests/fail/data_race/atomic_read_na_write_race2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ pub fn main() {
2323

2424
let j2 = spawn(move || {
2525
let atomic_ref = &mut *c.0;
26-
*atomic_ref.get_mut() = 32; //~ ERROR: Data race detected between Write on thread `<unnamed>` and Atomic Load on thread `<unnamed>`
26+
*atomic_ref.get_mut() = 32; //~ ERROR: Data race detected between (1) Write on thread `<unnamed>` and (2) Atomic Load on thread `<unnamed>`
2727
});
2828

2929
j1.join().unwrap();

src/tools/miri/tests/fail/data_race/atomic_read_na_write_race2.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
error: Undefined Behavior: Data race detected between Write on thread `<unnamed>` and Atomic Load on thread `<unnamed>` at ALLOC. The Write is here
1+
error: Undefined Behavior: Data race detected between (1) Write on thread `<unnamed>` and (2) Atomic Load on thread `<unnamed>` at ALLOC. (1) just happened here
22
--> $DIR/atomic_read_na_write_race2.rs:LL:CC
33
|
44
LL | *atomic_ref.get_mut() = 32;
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ Data race detected between Write on thread `<unnamed>` and Atomic Load on thread `<unnamed>` at ALLOC. The Write is here
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ Data race detected between (1) Write on thread `<unnamed>` and (2) Atomic Load on thread `<unnamed>` at ALLOC. (1) just happened here
66
|
7-
help: and the Atomic Load on thread `<unnamed>` is here
7+
help: and (2) occurred earlier here
88
--> $DIR/atomic_read_na_write_race2.rs:LL:CC
99
|
1010
LL | atomic_ref.load(Ordering::SeqCst)

src/tools/miri/tests/fail/data_race/atomic_write_na_read_race1.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ pub fn main() {
2323

2424
let j2 = spawn(move || {
2525
let atomic_ref = &mut *c.0;
26-
*atomic_ref.get_mut() //~ ERROR: Data race detected between Read on thread `<unnamed>` and Atomic Store on thread `<unnamed>`
26+
*atomic_ref.get_mut() //~ ERROR: Data race detected between (1) Read on thread `<unnamed>` and (2) Atomic Store on thread `<unnamed>`
2727
});
2828

2929
j1.join().unwrap();

src/tools/miri/tests/fail/data_race/atomic_write_na_read_race1.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
error: Undefined Behavior: Data race detected between Read on thread `<unnamed>` and Atomic Store on thread `<unnamed>` at ALLOC. The Read is here
1+
error: Undefined Behavior: Data race detected between (1) Read on thread `<unnamed>` and (2) Atomic Store on thread `<unnamed>` at ALLOC. (1) just happened here
22
--> $DIR/atomic_write_na_read_race1.rs:LL:CC
33
|
44
LL | *atomic_ref.get_mut()
5-
| ^^^^^^^^^^^^^^^^^^^^^ Data race detected between Read on thread `<unnamed>` and Atomic Store on thread `<unnamed>` at ALLOC. The Read is here
5+
| ^^^^^^^^^^^^^^^^^^^^^ Data race detected between (1) Read on thread `<unnamed>` and (2) Atomic Store on thread `<unnamed>` at ALLOC. (1) just happened here
66
|
7-
help: and the Atomic Store on thread `<unnamed>` is here
7+
help: and (2) occurred earlier here
88
--> $DIR/atomic_write_na_read_race1.rs:LL:CC
99
|
1010
LL | atomic_ref.store(32, Ordering::SeqCst)

src/tools/miri/tests/fail/data_race/atomic_write_na_read_race2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ pub fn main() {
2020
});
2121

2222
let j2 = spawn(move || {
23-
(&*c.0).store(32, Ordering::SeqCst); //~ ERROR: Data race detected between Atomic Store on thread `<unnamed>` and Read on thread `<unnamed>`
23+
(&*c.0).store(32, Ordering::SeqCst); //~ ERROR: Data race detected between (1) Atomic Store on thread `<unnamed>` and (2) Read on thread `<unnamed>`
2424
});
2525

2626
j1.join().unwrap();

src/tools/miri/tests/fail/data_race/atomic_write_na_read_race2.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
error: Undefined Behavior: Data race detected between Atomic Store on thread `<unnamed>` and Read on thread `<unnamed>` at ALLOC. The Atomic Store is here
1+
error: Undefined Behavior: Data race detected between (1) Atomic Store on thread `<unnamed>` and (2) Read on thread `<unnamed>` at ALLOC. (1) just happened here
22
--> $DIR/atomic_write_na_read_race2.rs:LL:CC
33
|
44
LL | (&*c.0).store(32, Ordering::SeqCst);
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Data race detected between Atomic Store on thread `<unnamed>` and Read on thread `<unnamed>` at ALLOC. The Atomic Store is here
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Data race detected between (1) Atomic Store on thread `<unnamed>` and (2) Read on thread `<unnamed>` at ALLOC. (1) just happened here
66
|
7-
help: and the Read on thread `<unnamed>` is here
7+
help: and (2) occurred earlier here
88
--> $DIR/atomic_write_na_read_race2.rs:LL:CC
99
|
1010
LL | let _val = *(c.0 as *mut usize);

src/tools/miri/tests/fail/data_race/atomic_write_na_write_race1.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ pub fn main() {
2020
});
2121

2222
let j2 = spawn(move || {
23-
(&*c.0).store(64, Ordering::SeqCst); //~ ERROR: Data race detected between Atomic Store on thread `<unnamed>` and Write on thread `<unnamed>`
23+
(&*c.0).store(64, Ordering::SeqCst); //~ ERROR: Data race detected between (1) Atomic Store on thread `<unnamed>` and (2) Write on thread `<unnamed>`
2424
});
2525

2626
j1.join().unwrap();

src/tools/miri/tests/fail/data_race/atomic_write_na_write_race1.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
error: Undefined Behavior: Data race detected between Atomic Store on thread `<unnamed>` and Write on thread `<unnamed>` at ALLOC. The Atomic Store is here
1+
error: Undefined Behavior: Data race detected between (1) Atomic Store on thread `<unnamed>` and (2) Write on thread `<unnamed>` at ALLOC. (1) just happened here
22
--> $DIR/atomic_write_na_write_race1.rs:LL:CC
33
|
44
LL | (&*c.0).store(64, Ordering::SeqCst);
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Data race detected between Atomic Store on thread `<unnamed>` and Write on thread `<unnamed>` at ALLOC. The Atomic Store is here
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Data race detected between (1) Atomic Store on thread `<unnamed>` and (2) Write on thread `<unnamed>` at ALLOC. (1) just happened here
66
|
7-
help: and the Write on thread `<unnamed>` is here
7+
help: and (2) occurred earlier here
88
--> $DIR/atomic_write_na_write_race1.rs:LL:CC
99
|
1010
LL | *(c.0 as *mut usize) = 32;

src/tools/miri/tests/fail/data_race/atomic_write_na_write_race2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ pub fn main() {
2323

2424
let j2 = spawn(move || {
2525
let atomic_ref = &mut *c.0;
26-
*atomic_ref.get_mut() = 32; //~ ERROR: Data race detected between Write on thread `<unnamed>` and Atomic Store on thread `<unnamed>`
26+
*atomic_ref.get_mut() = 32; //~ ERROR: Data race detected between (1) Write on thread `<unnamed>` and (2) Atomic Store on thread `<unnamed>`
2727
});
2828

2929
j1.join().unwrap();

src/tools/miri/tests/fail/data_race/atomic_write_na_write_race2.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
error: Undefined Behavior: Data race detected between Write on thread `<unnamed>` and Atomic Store on thread `<unnamed>` at ALLOC. The Write is here
1+
error: Undefined Behavior: Data race detected between (1) Write on thread `<unnamed>` and (2) Atomic Store on thread `<unnamed>` at ALLOC. (1) just happened here
22
--> $DIR/atomic_write_na_write_race2.rs:LL:CC
33
|
44
LL | *atomic_ref.get_mut() = 32;
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ Data race detected between Write on thread `<unnamed>` and Atomic Store on thread `<unnamed>` at ALLOC. The Write is here
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ Data race detected between (1) Write on thread `<unnamed>` and (2) Atomic Store on thread `<unnamed>` at ALLOC. (1) just happened here
66
|
7-
help: and the Atomic Store on thread `<unnamed>` is here
7+
help: and (2) occurred earlier here
88
--> $DIR/atomic_write_na_write_race2.rs:LL:CC
99
|
1010
LL | atomic_ref.store(64, Ordering::SeqCst);

src/tools/miri/tests/fail/data_race/dangling_thread_async_race.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ fn main() {
3434

3535
let join2 = unsafe {
3636
spawn(move || {
37-
*c.0 = 64; //~ ERROR: Data race detected between Write on thread `<unnamed>` and Write on thread `<unnamed>`
37+
*c.0 = 64; //~ ERROR: Data race detected between (1) Write on thread `<unnamed>` and (2) Write on thread `<unnamed>`
3838
})
3939
};
4040

src/tools/miri/tests/fail/data_race/dangling_thread_async_race.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
error: Undefined Behavior: Data race detected between Write on thread `<unnamed>` and Write on thread `<unnamed>` at ALLOC. The Write is here
1+
error: Undefined Behavior: Data race detected between (1) Write on thread `<unnamed>` and (2) Write on thread `<unnamed>` at ALLOC. (1) just happened here
22
--> $DIR/dangling_thread_async_race.rs:LL:CC
33
|
44
LL | *c.0 = 64;
5-
| ^^^^^^^^^ Data race detected between Write on thread `<unnamed>` and Write on thread `<unnamed>` at ALLOC. The Write is here
5+
| ^^^^^^^^^ Data race detected between (1) Write on thread `<unnamed>` and (2) Write on thread `<unnamed>` at ALLOC. (1) just happened here
66
|
7-
help: and the Write on thread `<unnamed>` is here
7+
help: and (2) occurred earlier here
88
--> $DIR/dangling_thread_async_race.rs:LL:CC
99
|
1010
LL | *c.0 = 32;

src/tools/miri/tests/fail/data_race/dangling_thread_race.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,6 @@ fn main() {
3333
spawn(|| ()).join().unwrap();
3434

3535
unsafe {
36-
*c.0 = 64; //~ ERROR: Data race detected between Write on thread `main` and Write on thread `<unnamed>`
36+
*c.0 = 64; //~ ERROR: Data race detected between (1) Write on thread `main` and (2) Write on thread `<unnamed>`
3737
}
3838
}

src/tools/miri/tests/fail/data_race/dangling_thread_race.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
error: Undefined Behavior: Data race detected between Write on thread `main` and Write on thread `<unnamed>` at ALLOC. The Write is here
1+
error: Undefined Behavior: Data race detected between (1) Write on thread `main` and (2) Write on thread `<unnamed>` at ALLOC. (1) just happened here
22
--> $DIR/dangling_thread_race.rs:LL:CC
33
|
44
LL | *c.0 = 64;
5-
| ^^^^^^^^^ Data race detected between Write on thread `main` and Write on thread `<unnamed>` at ALLOC. The Write is here
5+
| ^^^^^^^^^ Data race detected between (1) Write on thread `main` and (2) Write on thread `<unnamed>` at ALLOC. (1) just happened here
66
|
7-
help: and the Write on thread `<unnamed>` is here
7+
help: and (2) occurred earlier here
88
--> $DIR/dangling_thread_race.rs:LL:CC
99
|
1010
LL | *c.0 = 32;

src/tools/miri/tests/fail/data_race/dealloc_read_race1.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ pub fn main() {
2525

2626
let j2 = spawn(move || {
2727
__rust_dealloc(
28-
//~^ ERROR: Data race detected between Deallocate on thread `<unnamed>` and Read on thread `<unnamed>`
28+
//~^ ERROR: Data race detected between (1) Deallocate on thread `<unnamed>` and (2) Read on thread `<unnamed>`
2929
ptr.0 as *mut _,
3030
std::mem::size_of::<usize>(),
3131
std::mem::align_of::<usize>(),

src/tools/miri/tests/fail/data_race/dealloc_read_race1.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: Undefined Behavior: Data race detected between Deallocate on thread `<unnamed>` and Read on thread `<unnamed>` at ALLOC. The Deallocate is here
1+
error: Undefined Behavior: Data race detected between (1) Deallocate on thread `<unnamed>` and (2) Read on thread `<unnamed>` at ALLOC. (1) just happened here
22
--> $DIR/dealloc_read_race1.rs:LL:CC
33
|
44
LL | / __rust_dealloc(
@@ -7,9 +7,9 @@ LL | | ptr.0 as *mut _,
77
LL | | std::mem::size_of::<usize>(),
88
LL | | std::mem::align_of::<usize>(),
99
LL | | );
10-
| |_____________^ Data race detected between Deallocate on thread `<unnamed>` and Read on thread `<unnamed>` at ALLOC. The Deallocate is here
10+
| |_____________^ Data race detected between (1) Deallocate on thread `<unnamed>` and (2) Read on thread `<unnamed>` at ALLOC. (1) just happened here
1111
|
12-
help: and the Read on thread `<unnamed>` is here
12+
help: and (2) occurred earlier here
1313
--> $DIR/dealloc_read_race1.rs:LL:CC
1414
|
1515
LL | let _val = *ptr.0;

src/tools/miri/tests/fail/data_race/dealloc_read_race2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ pub fn main() {
2828
});
2929

3030
let j2 = spawn(move || {
31-
// Also an error of the form: Data race detected between Read on thread `<unnamed>` and Deallocate on thread `<unnamed>`
31+
// Also an error of the form: Data race detected between (1) Read on thread `<unnamed>` and (2) Deallocate on thread `<unnamed>`
3232
// but the invalid allocation is detected first.
3333
*ptr.0 //~ ERROR: dereferenced after this allocation got freed
3434
});

src/tools/miri/tests/fail/data_race/dealloc_read_race_stack.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ pub fn main() {
3535
sleep(Duration::from_millis(200));
3636

3737
// Now `stack_var` gets deallocated.
38-
} //~ ERROR: Data race detected between Deallocate on thread `<unnamed>` and Read on thread `<unnamed>`
38+
} //~ ERROR: Data race detected between (1) Deallocate on thread `<unnamed>` and (2) Read on thread `<unnamed>`
3939
});
4040

4141
let j2 = spawn(move || {

src/tools/miri/tests/fail/data_race/dealloc_read_race_stack.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
error: Undefined Behavior: Data race detected between Deallocate on thread `<unnamed>` and Read on thread `<unnamed>` at ALLOC. The Deallocate is here
1+
error: Undefined Behavior: Data race detected between (1) Deallocate on thread `<unnamed>` and (2) Read on thread `<unnamed>` at ALLOC. (1) just happened here
22
--> $DIR/dealloc_read_race_stack.rs:LL:CC
33
|
44
LL | }
5-
| ^ Data race detected between Deallocate on thread `<unnamed>` and Read on thread `<unnamed>` at ALLOC. The Deallocate is here
5+
| ^ Data race detected between (1) Deallocate on thread `<unnamed>` and (2) Read on thread `<unnamed>` at ALLOC. (1) just happened here
66
|
7-
help: and the Read on thread `<unnamed>` is here
7+
help: and (2) occurred earlier here
88
--> $DIR/dealloc_read_race_stack.rs:LL:CC
99
|
1010
LL | *pointer.load(Ordering::Acquire)

src/tools/miri/tests/fail/data_race/dealloc_write_race1.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ pub fn main() {
2424

2525
let j2 = spawn(move || {
2626
__rust_dealloc(
27-
//~^ ERROR: Data race detected between Deallocate on thread `<unnamed>` and Write on thread `<unnamed>`
27+
//~^ ERROR: Data race detected between (1) Deallocate on thread `<unnamed>` and (2) Write on thread `<unnamed>`
2828
ptr.0 as *mut _,
2929
std::mem::size_of::<usize>(),
3030
std::mem::align_of::<usize>(),

src/tools/miri/tests/fail/data_race/dealloc_write_race1.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: Undefined Behavior: Data race detected between Deallocate on thread `<unnamed>` and Write on thread `<unnamed>` at ALLOC. The Deallocate is here
1+
error: Undefined Behavior: Data race detected between (1) Deallocate on thread `<unnamed>` and (2) Write on thread `<unnamed>` at ALLOC. (1) just happened here
22
--> $DIR/dealloc_write_race1.rs:LL:CC
33
|
44
LL | / __rust_dealloc(
@@ -7,9 +7,9 @@ LL | | ptr.0 as *mut _,
77
LL | | std::mem::size_of::<usize>(),
88
LL | | std::mem::align_of::<usize>(),
99
LL | | );
10-
| |_____________^ Data race detected between Deallocate on thread `<unnamed>` and Write on thread `<unnamed>` at ALLOC. The Deallocate is here
10+
| |_____________^ Data race detected between (1) Deallocate on thread `<unnamed>` and (2) Write on thread `<unnamed>` at ALLOC. (1) just happened here
1111
|
12-
help: and the Write on thread `<unnamed>` is here
12+
help: and (2) occurred earlier here
1313
--> $DIR/dealloc_write_race1.rs:LL:CC
1414
|
1515
LL | *ptr.0 = 2;

0 commit comments

Comments
 (0)