rust/tests/ui/consts/promoted_const_call4.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

19 lines
342 B
Rust
Raw Normal View History

2022-12-01 13:41:59 +00:00
// 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));
}