Skip to content

Commit e6ac700

Browse files
committed
[move-only] QoI: Fix up error notes from "{non,}consuming use" -> "{non,}consuming use here".
rdar://104926091
1 parent 4e86268 commit e6ac700

10 files changed

+1821
-1821
lines changed

include/swift/AST/DiagnosticsSIL.def

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -753,15 +753,15 @@ NOTE(sil_moveonlychecker_moveonly_field_consumed_here, none,
753753
NOTE(sil_moveonlychecker_boundary_use, none,
754754
"boundary use here", ())
755755
NOTE(sil_moveonlychecker_consuming_use_here, none,
756-
"consuming use", ())
756+
"consuming use here", ())
757757
NOTE(sil_moveonlychecker_two_consuming_uses_here, none,
758758
"two consuming uses here", ())
759759
NOTE(sil_moveonlychecker_consuming_and_non_consuming_uses_here, none,
760760
"consuming and non-consuming uses here", ())
761761
NOTE(sil_moveonlychecker_consuming_closure_use_here, none,
762-
"closure capture", ())
762+
"closure capture here", ())
763763
NOTE(sil_moveonlychecker_nonconsuming_use_here, none,
764-
"non-consuming use", ())
764+
"non-consuming use here", ())
765765
ERROR(sil_moveonlychecker_not_understand_no_implicit_copy, none,
766766
"Usage of @noImplicitCopy that the move checker does not know how to "
767767
"check!", ())

test/SILOptimizer/moveonly_addresschecker_diagnostics.sil

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ bb0(%0 : $Int):
8282
end_access %8 : $*AggStruct
8383
%12 = begin_access [read] [static] %3 : $*AggStruct
8484
%13 = struct_element_addr %12 : $*AggStruct, #AggStruct.lhs
85-
%14 = load [copy] %13 : $*Klass // expected-note {{consuming use}}
85+
%14 = load [copy] %13 : $*Klass // expected-note {{consuming use here}}
8686
end_access %12 : $*AggStruct
8787
%16 = move_value [lexical] %14 : $Klass
8888
%17 = mark_must_check [no_implicit_copy] %16 : $Klass
@@ -91,7 +91,7 @@ bb0(%0 : $Int):
9191
%20 = move_value %19 : $Klass
9292
destroy_value %20 : $Klass
9393
destroy_value %17 : $Klass
94-
%23 = load [copy] %3 : $*AggStruct // expected-note {{consuming use}}
94+
%23 = load [copy] %3 : $*AggStruct // expected-note {{consuming use here}}
9595
destroy_addr %3 : $*AggStruct
9696
dealloc_stack %2 : $*AggStruct
9797
return %23 : $AggStruct
@@ -109,7 +109,7 @@ bb0(%arg : @owned $AggStruct):
109109
%12 = begin_access [read] [static] %1 : $*AggStruct
110110
%13 = struct_element_addr %12 : $*AggStruct, #AggStruct.pair
111111
%14 = struct_element_addr %13 : $*KlassPair, #KlassPair.lhs
112-
%15 = load [copy] %14 : $*Klass // expected-note {{consuming use}}
112+
%15 = load [copy] %14 : $*Klass // expected-note {{consuming use here}}
113113
end_access %12 : $*AggStruct
114114
%17 = function_ref @classConsume : $@convention(thin) (@owned Klass) -> ()
115115
%18 = apply %17(%15) : $@convention(thin) (@owned Klass) -> ()
@@ -123,8 +123,8 @@ bb2(%55 : $Int):
123123
%57 = struct_element_addr %56 : $*AggStruct, #AggStruct.pair
124124
%58 = struct_element_addr %57 : $*KlassPair, #KlassPair.lhs
125125
%59 = load [copy] %58 : $*Klass
126-
// expected-note @-1 {{consuming use}}
127-
// expected-note @-2 {{consuming use}}
126+
// expected-note @-1 {{consuming use here}}
127+
// expected-note @-2 {{consuming use here}}
128128
end_access %56 : $*AggStruct
129129
%61 = function_ref @classConsume : $@convention(thin) (@owned Klass) -> ()
130130
%62 = apply %61(%59) : $@convention(thin) (@owned Klass) -> ()
@@ -187,13 +187,13 @@ bb0(%arg : @owned $NonTrivialStruct, %arg1 : @owned $NonTrivialStruct):
187187
end_access %12 : $*NonTrivialStruct
188188
%19 = begin_access [read] [static] %1 : $*NonTrivialStruct
189189
%20 = struct_element_addr %19 : $*NonTrivialStruct, #NonTrivialStruct.k
190-
%21 = load [copy] %20 : $*Klass // expected-note {{consuming use}}
190+
%21 = load [copy] %20 : $*Klass // expected-note {{consuming use here}}
191191
end_access %19 : $*NonTrivialStruct
192192
%23 = function_ref @classConsume : $@convention(thin) (@owned Klass) -> ()
193193
%24 = apply %23(%21) : $@convention(thin) (@owned Klass) -> ()
194194
%25 = begin_access [read] [static] %1 : $*NonTrivialStruct
195195
%26 = struct_element_addr %25 : $*NonTrivialStruct, #NonTrivialStruct.k
196-
%27 = load [copy] %26 : $*Klass // expected-note {{consuming use}}
196+
%27 = load [copy] %26 : $*Klass // expected-note {{consuming use here}}
197197
end_access %25 : $*NonTrivialStruct
198198
%29 = function_ref @classConsume : $@convention(thin) (@owned Klass) -> ()
199199
%30 = apply %29(%27) : $@convention(thin) (@owned Klass) -> ()

test/SILOptimizer/moveonly_addresschecker_diagnostics.swift

Lines changed: 401 additions & 401 deletions
Large diffs are not rendered by default.

test/SILOptimizer/moveonly_borrow_to_destructure_transform_diagnostics.sil

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ bb0(%0 : @guaranteed $AggStruct2):
7777
end_borrow %4a : $AggStruct2
7878
destroy_value %2 : $AggStruct2
7979
%9 = function_ref @moveonlyklass_consume : $@convention(thin) (@owned MoveOnlyKlass) -> ()
80-
apply %9(%7) : $@convention(thin) (@owned MoveOnlyKlass) -> () // expected-note {{consuming use}}
80+
apply %9(%7) : $@convention(thin) (@owned MoveOnlyKlass) -> () // expected-note {{consuming use here}}
8181
apply %9(%7a) : $@convention(thin) (@owned MoveOnlyKlass) -> () // expected-note {{boundary use here}}
8282
%9999 = tuple()
8383
return %9999 : $()
@@ -141,7 +141,7 @@ bb0(%0 : @owned $AggStruct2):
141141
%9 = struct_extract %8 : $AggStruct2, #AggStruct2.lhs
142142
%10 = copy_value %9 : $MoveOnlyKlass
143143
%11 = function_ref @moveonlyklass_consume : $@convention(thin) (@owned MoveOnlyKlass) -> ()
144-
%12 = apply %11(%10) : $@convention(thin) (@owned MoveOnlyKlass) -> () // expected-note {{consuming use}}
144+
%12 = apply %11(%10) : $@convention(thin) (@owned MoveOnlyKlass) -> () // expected-note {{consuming use here}}
145145
end_borrow %8 : $AggStruct2
146146
br bb1
147147

@@ -153,7 +153,7 @@ bb2:
153153
%52 = struct_extract %51 : $AggStruct2, #AggStruct2.lhs
154154
%53 = copy_value %52 : $MoveOnlyKlass
155155
%54 = function_ref @moveonlyklass_consume : $@convention(thin) (@owned MoveOnlyKlass) -> ()
156-
%55 = apply %54(%53) : $@convention(thin) (@owned MoveOnlyKlass) -> () // expected-note {{consuming use}}
156+
%55 = apply %54(%53) : $@convention(thin) (@owned MoveOnlyKlass) -> () // expected-note {{consuming use here}}
157157
end_borrow %51 : $AggStruct2
158158
br bb1
159159

test/SILOptimizer/moveonly_deinits.swift

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,18 @@ struct MoveOnlyStruct {
1010
var k = Klass()
1111

1212
deinit { // expected-error {{'self' consumed more than once}}
13-
let x = self // expected-note {{consuming use}}
13+
let x = self // expected-note {{consuming use here}}
1414
_ = x
1515
var y = MoveOnlyStruct() // expected-error {{'y' consumed more than once}}
16-
y = self // expected-note {{consuming use}}
16+
y = self // expected-note {{consuming use here}}
1717
// We get an infinite recursion since we are going to call our own
1818
// deinit here. We are just testing diagnostics here though.
1919
_ = y // expected-warning {{function call causes an infinite recursion}}
20-
// expected-note @-1 {{consuming use}}
21-
let z = y // expected-note {{consuming use}}
20+
// expected-note @-1 {{consuming use here}}
21+
let z = y // expected-note {{consuming use here}}
2222
let _ = z
23-
globalMoveOnlyStruct = self // expected-note {{consuming use}}
24-
} // expected-note {{consuming use}}
23+
globalMoveOnlyStruct = self // expected-note {{consuming use here}}
24+
} // expected-note {{consuming use here}}
2525
}
2626

2727
@_moveOnly
@@ -30,14 +30,14 @@ enum MoveOnlyEnum {
3030
case rhs(Klass)
3131

3232
deinit { // expected-error {{'self' consumed more than once}}
33-
let x = self // expected-note {{consuming use}}
33+
let x = self // expected-note {{consuming use here}}
3434
_ = x
3535
var y = MoveOnlyEnum.lhs(Klass())
36-
y = self // expected-note {{consuming use}}
36+
y = self // expected-note {{consuming use here}}
3737
// We get an infinite recursion since we are going to call our own
3838
// deinit here. We are just testing diagnostics here though.
3939
// expected-warning @-3 {{function call causes an infinite recursion}}
4040
_ = y
41-
globalMoveOnlyEnum = self // expected-note {{consuming use}}
42-
} // expected-note {{consuming use}}
41+
globalMoveOnlyEnum = self // expected-note {{consuming use here}}
42+
} // expected-note {{consuming use here}}
4343
}

0 commit comments

Comments
 (0)