swift
d64fda48 - [rbi] When looking for closure uses, handle unresolved_non_copyable_value and store_borrow temporaries.

Commit
6 days ago
[rbi] When looking for closure uses, handle unresolved_non_copyable_value and store_borrow temporaries. This ensures that in cases like the following: +func testNoncopyableNonsendableStructWithNonescapingMainActorAsync() { + let x = NoncopyableStructNonsendable() <========= + let _ = { + nonescapingAsyncClosure { @MainActor in + useValueNoncopyable(x) // expected-warning {{sending 'x' risks causing data races}} + // expected-note @-1 {{task-isolated 'x' is captured by a main actor-isolated closure. main actor-isolated uses in closure may race against later nonisolated uses}} + } + } +} We emit the diagnostic on the use instead of the <=====. rdar://166347485
Author
Committer
Parents
Loading