1 //! Make sure that a retag acts like a write for the data race model.
2 //@compile-flags: -Zmiri-preemption-rate=0
4 struct SendPtr(*mut u8);
6 unsafe impl Send for SendPtr {}
8 fn thread_1(p: SendPtr) {
15 fn thread_2(p: SendPtr) {
18 *p = 5; //~ ERROR: Data race detected between Write on thread `<unnamed>` and Read on thread `<unnamed>`
24 let p = std::ptr::addr_of_mut!(x);
27 let t1 = std::thread::spawn(move || thread_1(p));
28 let t2 = std::thread::spawn(move || thread_2(p));