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
Convert the noimplicitcopy addressonly fail test back to its original form.
For some reason in a previous commit, this started to work so I just added
support. In this PR, it changed again and the test started to fail again. We are
not shipping noimplicitcopy in 5.9, so I just changed the error message to the
old "I don't understand" error message.
I additionally looked at why the failure is occuring. The reason why is that the
frontend emits an unchecked_ref_cast since currently the
moveonlywrapper_to_copyable instruction does not accept addresses (even though
it could) and the field sensitive liveness analysis does not know how to
represent an unchecked_ref_cast (which is ok, since we would like it to be
rejected).
Copy file name to clipboardExpand all lines: test/SILOptimizer/move_only_checker_addressonly_fail.swift
+8-4Lines changed: 8 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -10,8 +10,12 @@ struct GenericAggregate<T> {
10
10
func test1<T>(_ x:T){
11
11
@_noImplicitCopyletx2= x // expected-error {{@_noImplicitCopy can not be used on a generic or existential typed binding or a nominal type containing such typed things}}
12
12
13
-
consumeValue(x2) // expected-error {{'x2' has guaranteed ownership but was consumed}}
14
-
// expected-note @-1 {{consuming use here}}
15
-
consumeValue(x2) // expected-error {{'x2' has guaranteed ownership but was consumed}}
16
-
// expected-note @-1 {{consuming use here}}
13
+
// These fail b/c we use an unchecked_addr_cast to convert addresses from
14
+
// @moveOnly to non-@moveOnly. We should change moveonly_to_copyable to
15
+
// handle addresses as well.
16
+
//
17
+
// An earlier change, I believe made it so that SILGen did not emit these
18
+
// unchecked_addr_cast.
19
+
consumeValue(x2) // expected-error {{Usage of @noImplicitCopy that the move checker does not know how to check!}}
20
+
consumeValue(x2) // expected-error {{Usage of @noImplicitCopy that the move checker does not know how to check!}}
0 commit comments