Skip to content

Commit e81838f

Browse files
committed
Revert "[region-isolation] Add a test showing that we do not infer nonisolated(unsafe) onto named closures."
This reverts commit 4ccb39e.
1 parent 2e06769 commit e81838f

File tree

1 file changed

+0
-14
lines changed

1 file changed

+0
-14
lines changed

test/Concurrency/transfernonsendable_nonisolatedunsafe.swift

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,18 +1028,4 @@ func closureTests() async {
10281028
// expected-note @-1 {{Passing value of non-Sendable type '() async -> ()' as a 'sending' argument to static method 'detached(priority:operation:)' risks causing races in between local and caller code}}
10291029
Task.detached { _ = x4a; _ = x4b } // expected-note {{access can happen concurrently}}
10301030
}
1031-
1032-
// The reason why this works is that we do not infer nonisolated(unsafe)
1033-
// passed the begin_borrow [var_decl] of y. So we think the closure is
1034-
// nonisolated(unsafe), but its uses via the begin_borrow [var_decl] is
1035-
// not.
1036-
func testNamedClosure() async {
1037-
nonisolated(unsafe) let x = NonSendableKlass()
1038-
let y = {
1039-
_ = x
1040-
}
1041-
sendingClosure(y) // expected-warning {{sending 'y' risks causing data races}}
1042-
// expected-note @-1 {{'y' used after being passed as a 'sending' parameter}}
1043-
sendingClosure(y) // expected-note {{access can happen concurrently}}
1044-
}
10451031
}

0 commit comments

Comments
 (0)