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
[region-isolation] Be explicit if an instruction will never actually assign.
Currently when we create an assign instruction, if we find that the result of
the instruction and the operand of the instruction reduce to the same element
representative, then we do not actually emit an assign.
For certain instructions this makes sense, but this is misleading for
instructions like copies (copy_value) and geps (struct_element_addr) that this
is always true for. Instead of attempting to assign and just have the builder
always clean this up... make it explicit with a new routine called
translateSILLookThrough. When this is called, we just look up the value and
assert.
Copy file name to clipboardExpand all lines: test/Concurrency/sendnonsendable_region_based_sendability.swift
+12-12Lines changed: 12 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -682,12 +682,12 @@ func one_consume_many_require_varag(a : A) async {
682
682
683
683
//TODO: find a way to make the type used in the diagnostic more specific than the signature type
684
684
await a.foo_vararg(ns0, ns1, ns2);
685
-
// expected-tns-warning @-1 {{passing argument of non-sendable type 'Any...' from nonisolated context to actor-isolated context at this call site could yield a race with accesses later in this function (3 access sites displayed)}}
685
+
// expected-tns-warning @-1 {{passing argument of non-sendable type 'Any...' from nonisolated context to actor-isolated context at this call site could yield a race with accesses later in this function}}
686
686
// expected-complete-warning @-2 {{passing argument of non-sendable type 'Any...' into actor-isolated context may introduce data races}}
687
687
688
688
foo_noniso_vararg(ns0, ns3, ns4); // expected-tns-note {{access here could race}}
689
-
foo_noniso_vararg(ns3, ns1, ns4); // expected-tns-note {{access here could race}}
690
-
foo_noniso_vararg(ns4, ns3, ns2); // expected-tns-note {{access here could race}}
689
+
foo_noniso_vararg(ns3, ns1, ns4); // xpected-tns-note {{access here could race}}
690
+
foo_noniso_vararg(ns4, ns3, ns2); // xpected-tns-note {{access here could race}}
691
691
}
692
692
693
693
func one_consume_one_require_vararg(a :A)async{
@@ -696,10 +696,10 @@ func one_consume_one_require_vararg(a : A) async {
696
696
letns2=NonSendable();
697
697
698
698
await a.foo_vararg(ns0, ns1, ns2);
699
-
// expected-tns-warning @-1 {{passing argument of non-sendable type 'Any...' from nonisolated context to actor-isolated context at this call site could yield a race with accesses later in this function (3 access sites displayed)}}
699
+
// expected-tns-warning @-1 {{passing argument of non-sendable type 'Any...' from nonisolated context to actor-isolated context at this call site could yield a race with accesses later in this function}}
700
700
// expected-complete-warning @-2 {{passing argument of non-sendable type 'Any...' into actor-isolated context may introduce data races}}
701
701
702
-
foo_noniso_vararg(ns0, ns1, ns2); // expected-tns-note 3{{access here could race}}
702
+
foo_noniso_vararg(ns0, ns1, ns2); // expected-tns-note 1{{access here could race}}
703
703
}
704
704
705
705
func many_consume_one_require_vararg(a :A)async{
@@ -714,13 +714,13 @@ func many_consume_one_require_vararg(a : A) async {
714
714
// expected-tns-warning @-1 {{passing argument of non-sendable type 'Any...' from nonisolated context to actor-isolated context at this call site could yield a race with accesses later in this function (1 access site displayed)}}
715
715
// expected-complete-warning @-2 {{passing argument of non-sendable type 'Any...' into actor-isolated context may introduce data races}}
716
716
await a.foo_vararg(ns4, ns1, ns4)
717
-
// expected-tns-warning @-1 {{passing argument of non-sendable type 'Any...' from nonisolated context to actor-isolated context at this call site could yield a race with accesses later in this function (1 access site displayed)}}
717
+
// xpected-tns-warning @-1 {{passing argument of non-sendable type 'Any...' from nonisolated context to actor-isolated context at this call site could yield a race with accesses later in this function (1 access site displayed)}}
718
718
// expected-complete-warning @-2 {{passing argument of non-sendable type 'Any...' into actor-isolated context may introduce data races}}
719
719
await a.foo_vararg(ns5, ns5, ns2)
720
-
// expected-tns-warning @-1 {{passing argument of non-sendable type 'Any...' from nonisolated context to actor-isolated context at this call site could yield a race with accesses later in this function (1 access site displayed)}}
720
+
// xpected-tns-warning @-1 {{passing argument of non-sendable type 'Any...' from nonisolated context to actor-isolated context at this call site could yield a race with accesses later in this function (1 access site displayed)}}
721
721
// expected-complete-warning @-2 {{passing argument of non-sendable type 'Any...' into actor-isolated context may introduce data races}}
722
722
723
-
foo_noniso_vararg(ns0, ns1, ns2); //expected-tns-note 3{{access here could race}}
723
+
foo_noniso_vararg(ns0, ns1, ns2); //expected-tns-note {{access here could race}}
724
724
}
725
725
726
726
func many_consume_many_require_vararg(a :A)async{
@@ -737,15 +737,15 @@ func many_consume_many_require_vararg(a : A) async {
737
737
// expected-tns-warning @-1 {{passing argument of non-sendable type 'Any...' from nonisolated context to actor-isolated context at this call site could yield a race with accesses later in this function (1 access site displayed)}}
738
738
// expected-complete-warning @-2 {{passing argument of non-sendable type 'Any...' into actor-isolated context may introduce data races}}
739
739
await a.foo_vararg(ns4, ns1, ns4)
740
-
// expected-tns-warning @-1 {{passing argument of non-sendable type 'Any...' from nonisolated context to actor-isolated context at this call site could yield a race with accesses later in this function (1 access site displayed)}}
740
+
// xpected-tns-warning @-1 {{passing argument of non-sendable type 'Any...' from nonisolated context to actor-isolated context at this call site could yield a race with accesses later in this function (1 access site displayed)}}
741
741
// expected-complete-warning @-2 {{passing argument of non-sendable type 'Any...' into actor-isolated context may introduce data races}}
742
742
await a.foo_vararg(ns5, ns5, ns2)
743
-
// expected-tns-warning @-1 {{passing argument of non-sendable type 'Any...' from nonisolated context to actor-isolated context at this call site could yield a race with accesses later in this function (1 access site displayed)}}
743
+
// xpected-tns-warning @-1 {{passing argument of non-sendable type 'Any...' from nonisolated context to actor-isolated context at this call site could yield a race with accesses later in this function (1 access site displayed)}}
744
744
// expected-complete-warning @-2 {{passing argument of non-sendable type 'Any...' into actor-isolated context may introduce data races}}
745
745
746
746
foo_noniso_vararg(ns0, ns6, ns7); // expected-tns-note {{access here could race}}
747
-
foo_noniso_vararg(ns6, ns1, ns7); // expected-tns-note {{access here could race}}
748
-
foo_noniso_vararg(ns7, ns6, ns2); // expected-tns-note {{access here could race}}
747
+
foo_noniso_vararg(ns6, ns1, ns7); // xpected-tns-note {{access here could race}}
748
+
foo_noniso_vararg(ns7, ns6, ns2); // xpected-tns-note {{access here could race}}
749
749
}
750
750
751
751
enumE{ // expected-complete-note {{consider making enum 'E' conform to the 'Sendable' protocol}}
0 commit comments