blob: 7a65ad86a9adb080d643f19db552670f67b4f55a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
//@ run-pass
use std::sync::atomic::*;
static FLAG: AtomicBool = AtomicBool::new(false);
struct NoisyDrop(#[allow(dead_code)] &'static str);
impl Drop for NoisyDrop {
fn drop(&mut self) {
FLAG.store(true, Ordering::SeqCst);
}
}
fn main() {
{
let _val = &&(NoisyDrop("drop!"), 0).1;
}
assert!(FLAG.load(Ordering::SeqCst));
}
|