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 9add632 commit afcd33aCopy full SHA for afcd33a
src/test/ui/consts/issue-90762.rs
@@ -0,0 +1,26 @@
1
+// run-pass
2
+#![allow(unreachable_code)]
3
+
4
+use std::sync::atomic::{AtomicBool, Ordering};
5
6
+struct Print(usize);
7
8
+impl Drop for Print {
9
+ fn drop(&mut self) {
10
+ FOO[self.0].store(true, Ordering::Relaxed);
11
+ }
12
+}
13
14
+const A: Print = Print(0);
15
+const B: Print = Print(1);
16
17
+static FOO: [AtomicBool; 3] = [AtomicBool::new(false), AtomicBool::new(false), AtomicBool::new(false)];
18
19
+fn main() {
20
+ loop {
21
+ std::mem::forget(({A}, B, Print(2), break));
22
23
+ for (i, b) in FOO.iter().enumerate() {
24
+ assert!(b.load(Ordering::Relaxed), "{} not set", i);
25
26
0 commit comments