add a closure inside an unsafe fn to the tests

This commit is contained in:
Ralf Jung 2017-08-01 13:14:32 -07:00
parent c5154d036d
commit a8129d128c

View file

@ -14,6 +14,8 @@
// Make sure unsafe fns and fns with an unsafe block only get restricted validation.
unsafe fn write_42(x: *mut i32) -> bool {
let test_closure = |x: *mut i32| *x = 23;
test_closure(x);
*x = 42;
true
}
@ -43,7 +45,7 @@ fn main() {
// }
// }
// END rustc.node4.EraseRegions.after.mir
// START rustc.node17.EraseRegions.after.mir
// START rustc.node31.EraseRegions.after.mir
// fn test(_1: &ReErased mut i32) -> () {
// bb0: {
// 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() {
// Validate(Release, [_3: bool]);
// }
// }
// END rustc.node17.EraseRegions.after.mir
// END rustc.node31.EraseRegions.after.mir