Skip to content

Commit 6adefc3

Browse files
committed
make the drop have a side-effect
1 parent 78c76c3 commit 6adefc3

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

tests/ui/loop-match/drop-in-match-arm.rs

+8-1
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,21 @@
66
#![allow(incomplete_features)]
77
#![feature(loop_match)]
88

9+
use std::sync::atomic::{AtomicBool, Ordering};
10+
911
fn main() {
1012
assert_eq!(helper(), 1);
13+
assert!(DROPPED.load(Ordering::Relaxed));
1114
}
1215

16+
static DROPPED: AtomicBool = AtomicBool::new(false);
17+
1318
struct X;
1419

1520
impl Drop for X {
16-
fn drop(&mut self) {}
21+
fn drop(&mut self) {
22+
DROPPED.store(true, Ordering::Relaxed);
23+
}
1724
}
1825

1926
#[no_mangle]

0 commit comments

Comments
 (0)