summaryrefslogtreecommitdiffstats
path: root/tests/ui/consts/promoted_const_call4.rs
blob: 82a17b7bf863f77822eb60d169f24ef525623e34 (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(&'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));
}