@@ -58,17 +58,7 @@ struct DeinitStruct {
58
58
var fourth : ( MoveOnlyKlass , MoveOnlyKlass )
59
59
var fifth : MoveOnlyKlass
60
60
61
- deinit { }
62
- // expected-note @-1 {{deinit declared here}}
63
- // expected-note @-2 {{deinit declared here}}
64
- // expected-note @-3 {{deinit declared here}}
65
- // expected-note @-4 {{deinit declared here}}
66
- // expected-note @-5 {{deinit declared here}}
67
- // expected-note @-6 {{deinit declared here}}
68
- // expected-note @-7 {{deinit declared here}}
69
- // expected-note @-8 {{deinit declared here}}
70
- // expected-note @-9 {{deinit declared here}}
71
- // expected-note @-10 {{deinit declared here}}
61
+ deinit { } // expected-note 10{{deinit declared here}}
72
62
}
73
63
74
64
func testConsumeCopyable( _ x: consuming DeinitStruct ) {
@@ -78,24 +68,24 @@ func testConsumeCopyable(_ x: consuming DeinitStruct) {
78
68
}
79
69
80
70
func testConsumeNonCopyable1( _ x: consuming DeinitStruct ) {
81
- // expected-error @- 1 {{Cannot partially consume 'x' since it has a user defined deinit}}
82
- consume ( x. third. rhs) // expected-note {{consuming use here}}
71
+ // expected-error @+ 1 {{cannot partially consume 'x' since it has a user defined deinit}}
72
+ consume ( x. third. rhs)
83
73
}
84
74
85
75
func testConsumeNonCopyable2( _ x: consuming DeinitStruct ) {
86
- // expected-error @- 1 {{Cannot partially consume 'x' since it has a user defined deinit}}
87
- consume ( x. fourth. 0 ) // expected-note {{consuming use here}}
76
+ // expected-error @+ 1 {{cannot partially consume 'x' since it has a user defined deinit}}
77
+ consume ( x. fourth. 0 )
88
78
}
89
79
90
80
func testConsumeNonCopyable3( _ x: consuming DeinitStruct ) {
91
- // expected-error @- 1 {{Cannot partially consume 'x' since it has a user defined deinit}}
92
- consume ( x. fourth. 1 ) // expected-note {{consuming use here}}
81
+ // expected-error @+ 1 {{cannot partially consume 'x' since it has a user defined deinit}}
82
+ consume ( x. fourth. 1 )
93
83
}
94
84
95
85
96
86
func testConsumeNonCopyable4( _ x: consuming DeinitStruct ) {
97
- // expected-error @- 1 {{Cannot partially consume 'x' since it has a user defined deinit}}
98
- consume ( x. fifth) // expected-note {{consuming use here}}
87
+ // expected-error @+ 1 {{cannot partially consume 'x' since it has a user defined deinit}}
88
+ consume ( x. fifth)
99
89
}
100
90
101
91
/////////////////
@@ -123,33 +113,33 @@ func testStructContainDeinitStructConsumeCopyable1(_ x: consuming StructContainD
123
113
}
124
114
125
115
126
- func testStructContainStructContainDeinitStructConsumeNonCopyable1( _ x : consuming StructContainDeinitStruct ) {
127
- // expected-error @- 1 {{Cannot partially consume 'x' since it contains field 'x .first' whose type 'DeinitStruct' has a user defined deinit}}
128
- consume ( x . first. third. rhs) // expected-note {{consuming use here}}
116
+ func testStructContainStructContainDeinitStructConsumeNonCopyable1( _ xyz : consuming StructContainDeinitStruct ) {
117
+ // expected-error @+ 1 {{cannot partially consume 'xyz .first' since it has a user defined deinit}}
118
+ consume ( xyz . first. third. rhs)
129
119
}
130
120
131
121
func testStructContainStructContainDeinitStructConsumeNonCopyable1a( _ x: consuming StructContainDeinitStruct ) {
132
- // expected-error @- 1 {{Cannot partially consume 'x' since it contains field 'x .second.0' whose type 'DeinitStruct' has a user defined deinit}}
133
- consume ( x. second. 0 . third. rhs) // expected-note {{consuming use here}}
122
+ // expected-error @+ 1 {{cannot partially consume 'x.second.0' since it has a user defined deinit}}
123
+ consume ( x. second. 0 . third. rhs)
134
124
}
135
125
136
126
func testStructContainStructContainDeinitStructConsumeNonCopyable2( _ x: consuming StructContainDeinitStruct ) {
137
- // expected-error @- 1 {{Cannot partially consume 'x' since it contains field 'x .first' whose type 'DeinitStruct' has a user defined deinit}}
138
- consume ( x. first. fourth. 0 ) // expected-note {{consuming use here}}
127
+ // expected-error @+ 1 {{cannot partially consume 'x.first' since it has a user defined deinit}}
128
+ consume ( x. first. fourth. 0 )
139
129
}
140
130
141
131
func testStructContainStructContainDeinitStructConsumeNonCopyable2a( _ x: consuming StructContainDeinitStruct ) {
142
- // expected-error @- 1 {{Cannot partially consume 'x' since it contains field 'x .second.1' whose type 'DeinitStruct' has a user defined deinit}}
143
- consume ( x. second. 1 . fourth. 0 ) // expected-note {{consuming use here}}
132
+ // expected-error @+ 1 {{cannot partially consume 'x.second.1' since it has a user defined deinit}}
133
+ consume ( x. second. 1 . fourth. 0 )
144
134
}
145
135
146
136
func testStructContainStructContainDeinitStructConsumeNonCopyable3( _ x: consuming StructContainDeinitStruct ) {
147
- // expected-error @- 1 {{Cannot partially consume 'x' since it contains field 'x .first' whose type 'DeinitStruct' has a user defined deinit}}
148
- consume ( x. first. fourth. 1 ) // expected-note {{consuming use here}}
137
+ // expected-error @+ 1 {{cannot partially consume 'x.first' since it has a user defined deinit}}
138
+ consume ( x. first. fourth. 1 )
149
139
}
150
140
151
141
152
142
func testStructContainStructContainDeinitStructConsumeNonCopyable4( _ x: consuming StructContainDeinitStruct ) {
153
- // expected-error @- 1 {{Cannot partially consume 'x' since it contains field 'x .first' whose type 'DeinitStruct' has a user defined deinit}}
154
- consume ( x. first. fifth) // expected-note {{consuming use here}}
143
+ // expected-error @+ 1 {{cannot partially consume 'x.first' since it has a user defined deinit}}
144
+ consume ( x. first. fifth)
155
145
}
0 commit comments