@@ -866,24 +866,26 @@ public func aggStructAccessFieldOwnedArg(@_noImplicitCopy _ x2: __owned AggStruc
866
866
867
867
public func aggStructConsumeField( _ x: AggStruct ) {
868
868
@_noImplicitCopy let x2 = x
869
+ // expected-error @-1 {{'x2' has a move only field that was consumed before later uses}}
869
870
classConsume ( x2. lhs)
870
871
for _ in 0 ..< 1024 {
871
- classConsume ( x2. lhs)
872
+ classConsume ( x2. lhs) // expected-note {{consuming use}}
872
873
}
873
874
}
874
875
875
- // TODO: We should error here!
876
876
public func aggStructConsumeFieldArg( @_noImplicitCopy _ x2: AggStruct ) {
877
+ // expected-error @-1 {{'x2' has a move only field that was consumed before later uses}}
877
878
classConsume ( x2. lhs)
878
879
for _ in 0 ..< 1024 {
879
- classConsume ( x2. lhs)
880
+ classConsume ( x2. lhs) // expected-note {{consuming use}}
880
881
}
881
882
}
882
883
883
884
public func aggStructConsumeFieldOwnedArg( @_noImplicitCopy _ x2: __owned AggStruct) {
885
+ // expected-error @-1 {{'x2' has a move only field that was consumed before later uses}}
884
886
classConsume ( x2. lhs)
885
887
for _ in 0 ..< 1024 {
886
- classConsume ( x2. lhs)
888
+ classConsume ( x2. lhs) // expected-note {{consuming use}}
887
889
}
888
890
}
889
891
@@ -911,24 +913,26 @@ public func aggStructAccessGrandFieldOwnedArg(@_noImplicitCopy _ x2: __owned Agg
911
913
912
914
public func aggStructConsumeGrandField( _ x: AggStruct ) {
913
915
@_noImplicitCopy let x2 = x
916
+ // expected-error @-1 {{'x2' has a move only field that was consumed before later uses}}
914
917
classConsume ( x2. pair. lhs)
915
918
for _ in 0 ..< 1024 {
916
- classConsume ( x2. pair. lhs)
919
+ classConsume ( x2. pair. lhs) // expected-note {{consuming use}}
917
920
}
918
921
}
919
922
920
- // TODO: This needs to error.
921
923
public func aggStructConsumeGrandFieldArg( @_noImplicitCopy _ x2: AggStruct ) {
924
+ // expected-error @-1 {{'x2' has a move only field that was consumed before later uses}}
922
925
classConsume ( x2. pair. lhs)
923
926
for _ in 0 ..< 1024 {
924
- classConsume ( x2. pair. lhs)
927
+ classConsume ( x2. pair. lhs) // expected-note {{consuming use}}
925
928
}
926
929
}
927
930
928
931
public func aggStructConsumeGrandFieldOwnedArg( @_noImplicitCopy _ x2: __owned AggStruct) {
932
+ // expected-error @-1 {{'x2' has a move only field that was consumed before later uses}}
929
933
classConsume ( x2. pair. lhs)
930
934
for _ in 0 ..< 1024 {
931
- classConsume ( x2. pair. lhs)
935
+ classConsume ( x2. pair. lhs) // expected-note {{consuming use}}
932
936
}
933
937
}
934
938
@@ -1132,23 +1136,26 @@ public func aggGenericStructAccessFieldOwnedArg(@_noImplicitCopy _ x2: __owned A
1132
1136
1133
1137
public func aggGenericStructConsumeField( _ x: AggGenericStruct < Klass > ) {
1134
1138
@_noImplicitCopy let x2 = x
1139
+ // expected-error @-1 {{'x2' has a move only field that was consumed before later uses}}
1135
1140
classConsume ( x2. lhs)
1136
1141
for _ in 0 ..< 1024 {
1137
- classConsume ( x2. lhs)
1142
+ classConsume ( x2. lhs) // expected-note {{consuming use}}
1138
1143
}
1139
1144
}
1140
1145
1141
1146
public func aggGenericStructConsumeFieldArg( @_noImplicitCopy _ x2: AggGenericStruct < Klass > ) {
1147
+ // expected-error @-1 {{'x2' has a move only field that was consumed before later uses}}
1142
1148
classConsume ( x2. lhs)
1143
1149
for _ in 0 ..< 1024 {
1144
- classConsume ( x2. lhs)
1150
+ classConsume ( x2. lhs) // expected-note {{consuming use}}
1145
1151
}
1146
1152
}
1147
1153
1148
1154
public func aggGenericStructConsumeFieldOwnedArg( @_noImplicitCopy _ x2: __owned AggGenericStruct< Klass > ) {
1155
+ // expected-error @-1 {{'x2' has a move only field that was consumed before later uses}}
1149
1156
classConsume ( x2. lhs)
1150
1157
for _ in 0 ..< 1024 {
1151
- classConsume ( x2. lhs)
1158
+ classConsume ( x2. lhs) // expected-note {{consuming use}}
1152
1159
}
1153
1160
}
1154
1161
@@ -1176,23 +1183,26 @@ public func aggGenericStructAccessGrandFieldOwnedArg(@_noImplicitCopy _ x2: __ow
1176
1183
1177
1184
public func aggGenericStructConsumeGrandField( _ x: AggGenericStruct < Klass > ) {
1178
1185
@_noImplicitCopy let x2 = x
1186
+ // expected-error @-1 {{'x2' has a move only field that was consumed before later uses}}
1179
1187
classConsume ( x2. pair. lhs)
1180
1188
for _ in 0 ..< 1024 {
1181
- classConsume ( x2. pair. lhs)
1189
+ classConsume ( x2. pair. lhs) // expected-note {{consuming use}}
1182
1190
}
1183
1191
}
1184
1192
1185
1193
public func aggGenericStructConsumeGrandFieldArg( @_noImplicitCopy _ x2: AggGenericStruct < Klass > ) {
1194
+ // expected-error @-1 {{'x2' has a move only field that was consumed before later uses}}
1186
1195
classConsume ( x2. pair. lhs)
1187
1196
for _ in 0 ..< 1024 {
1188
- classConsume ( x2. pair. lhs)
1197
+ classConsume ( x2. pair. lhs) // expected-note {{consuming use}}
1189
1198
}
1190
1199
}
1191
1200
1192
1201
public func aggGenericStructConsumeGrandFieldOwnedArg( @_noImplicitCopy _ x2: __owned AggGenericStruct< Klass > ) {
1202
+ // expected-error @-1 {{'x2' has a move only field that was consumed before later uses}}
1193
1203
classConsume ( x2. pair. lhs)
1194
1204
for _ in 0 ..< 1024 {
1195
- classConsume ( x2. pair. lhs)
1205
+ classConsume ( x2. pair. lhs) // expected-note {{consuming use}}
1196
1206
}
1197
1207
}
1198
1208
@@ -1390,23 +1400,26 @@ public func aggGenericStructAccessFieldOwnedArg<T>(@_noImplicitCopy _ x2: __owne
1390
1400
1391
1401
public func aggGenericStructConsumeField< T> ( _ x: AggGenericStruct < T > ) {
1392
1402
@_noImplicitCopy let x2 = x
1403
+ // expected-error @-1 {{'x2' has a move only field that was consumed before later uses}}
1393
1404
classConsume ( x2. lhs)
1394
1405
for _ in 0 ..< 1024 {
1395
- classConsume ( x2. lhs)
1406
+ classConsume ( x2. lhs) // expected-note {{consuming use}}
1396
1407
}
1397
1408
}
1398
1409
1399
1410
public func aggGenericStructConsumeFieldArg< T> ( @_noImplicitCopy _ x2: AggGenericStruct < T > ) {
1411
+ // expected-error @-1 {{'x2' has a move only field that was consumed before later uses}}
1400
1412
classConsume ( x2. lhs)
1401
1413
for _ in 0 ..< 1024 {
1402
- classConsume ( x2. lhs)
1414
+ classConsume ( x2. lhs) // expected-note {{consuming use}}
1403
1415
}
1404
1416
}
1405
1417
1406
1418
public func aggGenericStructConsumeFieldOwnedArg< T> ( @_noImplicitCopy _ x2: __owned AggGenericStruct< T > ) {
1419
+ // expected-error @-1 {{'x2' has a move only field that was consumed before later uses}}
1407
1420
classConsume ( x2. lhs)
1408
1421
for _ in 0 ..< 1024 {
1409
- classConsume ( x2. lhs)
1422
+ classConsume ( x2. lhs) // expected-note {{consuming use}}
1410
1423
}
1411
1424
}
1412
1425
@@ -1434,23 +1447,26 @@ public func aggGenericStructAccessGrandFieldOwnedArg<T>(@_noImplicitCopy _ x2: _
1434
1447
1435
1448
public func aggGenericStructConsumeGrandField< T> ( _ x: AggGenericStruct < T > ) {
1436
1449
@_noImplicitCopy let x2 = x
1450
+ // expected-error @-1 {{'x2' has a move only field that was consumed before later uses}}
1437
1451
classConsume ( x2. pair. lhs)
1438
1452
for _ in 0 ..< 1024 {
1439
- classConsume ( x2. pair. lhs)
1453
+ classConsume ( x2. pair. lhs) // expected-note {{consuming use}}
1440
1454
}
1441
1455
}
1442
1456
1443
1457
public func aggGenericStructConsumeGrandFieldArg< T> ( @_noImplicitCopy _ x2: AggGenericStruct < T > ) {
1458
+ // expected-error @-1 {{'x2' has a move only field that was consumed before later uses}}
1444
1459
classConsume ( x2. pair. lhs)
1445
1460
for _ in 0 ..< 1024 {
1446
- classConsume ( x2. pair. lhs)
1461
+ classConsume ( x2. pair. lhs) // expected-note {{consuming use}}
1447
1462
}
1448
1463
}
1449
1464
1450
1465
public func aggGenericStructConsumeGrandFieldOwnedArg< T> ( @_noImplicitCopy _ x2: __owned AggGenericStruct< T > ) {
1466
+ // expected-error @-1 {{'x2' has a move only field that was consumed before later uses}}
1451
1467
classConsume ( x2. pair. lhs)
1452
1468
for _ in 0 ..< 1024 {
1453
- classConsume ( x2. pair. lhs)
1469
+ classConsume ( x2. pair. lhs) // expected-note {{consuming use}}
1454
1470
}
1455
1471
}
1456
1472
0 commit comments