We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cbd406e commit 79c50cfCopy full SHA for 79c50cf
tests/tsan.rs
@@ -2,15 +2,15 @@
2
#![deny(rust_2018_idioms)]
3
#![deny(warnings)]
4
5
-use std::thread;
+use std::{ptr::addr_of_mut, thread};
6
7
use heapless::spsc;
8
9
#[test]
10
fn once() {
11
static mut RB: spsc::Queue<i32, 4> = spsc::Queue::new();
12
13
- let rb = unsafe { &mut RB };
+ let rb = unsafe { &mut *addr_of_mut!(RB) };
14
15
rb.enqueue(0).unwrap();
16
@@ -31,7 +31,7 @@ fn once() {
31
fn twice() {
32
static mut RB: spsc::Queue<i32, 5> = spsc::Queue::new();
33
34
35
36
37
rb.enqueue(1).unwrap();
0 commit comments