Skip to content

Commit a8129d1

Browse files
committed
add a closure inside an unsafe fn to the tests
1 parent c5154d0 commit a8129d1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/test/mir-opt/validate_4.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
// Make sure unsafe fns and fns with an unsafe block only get restricted validation.
1515

1616
unsafe fn write_42(x: *mut i32) -> bool {
17+
let test_closure = |x: *mut i32| *x = 23;
18+
test_closure(x);
1719
*x = 42;
1820
true
1921
}
@@ -43,7 +45,7 @@ fn main() {
4345
// }
4446
// }
4547
// END rustc.node4.EraseRegions.after.mir
46-
// START rustc.node17.EraseRegions.after.mir
48+
// START rustc.node31.EraseRegions.after.mir
4749
// fn test(_1: &ReErased mut i32) -> () {
4850
// bb0: {
4951
// Validate(Acquire, [_1: &ReFree(DefId { krate: CrateNum(0), node: DefIndex(4) => validate_4/8cd878b::test[0] }, BrAnon(0)) mut i32]);
@@ -55,4 +57,4 @@ fn main() {
5557
// Validate(Release, [_3: bool]);
5658
// }
5759
// }
58-
// END rustc.node17.EraseRegions.after.mir
60+
// END rustc.node31.EraseRegions.after.mir

0 commit comments

Comments
 (0)