Skip to content

Commit 9322658

Browse files
committed
add extract_if test that reproduces UB
Signed-off-by: Petros Angelatos <[email protected]>
1 parent 414482f commit 9322658

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
//@compile-flags: -Zmiri-recursive-validation
2+
3+
fn main() {
4+
let mut v = vec![Box::new(0u64), Box::new(1u64)];
5+
for item in v.extract_if(.., |x| **x == 0) {
6+
drop(item);
7+
}
8+
}

0 commit comments

Comments
 (0)