You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[rbi] Convert mutable box sending closure diagnostic to use modifiable instead of accessible in error message.
This emphasizes that the problem is that the mutable value could be modified in
multiple isolation domains which is clearer to the user.
I came up with this diagnostic in the previous commit for isolated partial
applies, so it makes sense to also be consistent with sending closures.
tryawaitwithThrowingTaskGroup(of:Void.self){ group in
1796
1796
group.addTask{ // expected-warning {{passing closure as a 'sending' parameter risks causing data races between code in the current task and concurrent execution of the closure}}
1797
-
useValue(x) // expected-note {{closure captures reference to mutable parameter 'x' which is accessible to code in the current task}}
1797
+
useValue(x) // expected-note {{closure captures reference to mutable parameter 'x' which remains modifiable by code in the current task}}
tryawaitwithThrowingTaskGroup(of:Void.self){ group in
1809
1809
group.addTask{ // expected-warning {{passing closure as a 'sending' parameter risks causing data races between code in the current task and concurrent execution of the closure}}
1810
-
useValue(x) // expected-note {{closure captures reference to mutable var 'x' which is accessible to code in the current task}}
1810
+
useValue(x) // expected-note {{closure captures reference to mutable var 'x' which remains modifiable by code in the current task}}
tryawaitwithThrowingTaskGroup(of:Void.self){ taskGroup in // expected-warning {{no calls to throwing functions occur within 'try' expression}}
1867
1867
taskGroup.addTask{ // expected-warning {{passing closure as a 'sending' parameter risks causing data races between code in the current task and concurrent execution of the closure}}
1868
-
result.append(input) // expected-note {{closure captures reference to mutable var 'result' which is accessible to code in the current task}}
1868
+
result.append(input) // expected-note {{closure captures reference to mutable var 'result' which remains modifiable by code in the current task}}
0 commit comments