]> git.lizzy.rs Git - rust.git/blob - tests/ui/consts/promoted_const_call4.rs
Rollup merge of #106951 - tmiasko:rm-simplify-initial, r=oli-obk
[rust.git] / tests / ui / consts / promoted_const_call4.rs
1 // run-pass
2
3 use std::sync::atomic::*;
4
5 static FLAG: AtomicBool = AtomicBool::new(false);
6
7 struct NoisyDrop(&'static str);
8 impl Drop for NoisyDrop {
9     fn drop(&mut self) {
10         FLAG.store(true, Ordering::SeqCst);
11     }
12 }
13 fn main() {
14     {
15         let _val = &&(NoisyDrop("drop!"), 0).1;
16     }
17     assert!(FLAG.load(Ordering::SeqCst));
18 }