@@ -19,13 +19,13 @@ func testExplicitCasts() {
19
19
func testCalls( ) {
20
20
let method = MethodSir ( )
21
21
let foo = NC ( )
22
- testBorrowing ( foo) // expected-warning {{implicit conversion to 'NC?' is consuming}}
23
- // expected-note@-1 {{add 'consume' to silence this warning }} {{17-17=consume }}
22
+ testBorrowing ( foo) // expected-error {{implicit conversion to 'NC?' is consuming}}
23
+ // expected-note@-1 {{add 'consume' to make consumption explicit }} {{17-17=consume }}
24
24
testBorrowing ( consume foo)
25
25
testBorrowing ( foo as NC ? )
26
26
27
- method. borrow ( foo) // expected-warning {{implicit conversion to 'NC?' is consuming}}
28
- // expected-note@-1 {{add 'consume' to silence this warning }} {{17-17=consume }}
27
+ method. borrow ( foo) // expected-error {{implicit conversion to 'NC?' is consuming}}
28
+ // expected-note@-1 {{add 'consume' to make consumption explicit }} {{17-17=consume }}
29
29
method. borrow ( consume foo)
30
30
31
31
testConsuming ( foo)
@@ -59,8 +59,8 @@ func delay(_ f: @autoclosure () -> NC?) -> NC? { f() }
59
59
60
60
func testDelay( ) {
61
61
let nc = NC ( )
62
- let _ = delay ( nc) // expected-warning {{implicit conversion to 'NC?' is consuming}}
63
- // expected-note@-1 {{add 'consume' to silence this warning }} {{17-17=consume }}
62
+ let _ = delay ( nc) // expected-error {{implicit conversion to 'NC?' is consuming}}
63
+ // expected-note@-1 {{add 'consume' to make consumption explicit }} {{17-17=consume }}
64
64
}
65
65
66
66
struct PropCity {
@@ -74,14 +74,14 @@ struct PropCity {
74
74
func chk( _ t: borrowing NC ! ) { }
75
75
func chkWithDefaultArg( _ oath: borrowing NC ? = NC ( ) ) { }
76
76
func test( _ nc: consuming NC ) {
77
- chk ( nc) // expected-warning {{implicit conversion to 'NC?' is consuming}}
78
- // expected-note@-1 {{add 'consume' to silence this warning }} {{9-9=consume }}
77
+ chk ( nc) // expected-error {{implicit conversion to 'NC?' is consuming}}
78
+ // expected-note@-1 {{add 'consume' to make consumption explicit }} {{9-9=consume }}
79
79
80
80
chk ( consume nc)
81
81
82
82
chkWithDefaultArg ( )
83
- chkWithDefaultArg ( nc) // expected-warning {{implicit conversion to 'NC?' is consuming}}
84
- // expected-note@-1 {{add 'consume' to silence this warning }} {{23-23=consume }}
83
+ chkWithDefaultArg ( nc) // expected-error {{implicit conversion to 'NC?' is consuming}}
84
+ // expected-note@-1 {{add 'consume' to make consumption explicit }} {{23-23=consume }}
85
85
}
86
86
}
87
87
@@ -93,16 +93,16 @@ func restockConsume(_ x: consuming any Veggie & ~Copyable) {}
93
93
94
94
func checkExistential( ) {
95
95
let carrot = Carrot ( )
96
- restockBorrow ( carrot) // expected-warning {{implicit conversion to 'any Veggie & ~Copyable' is consuming}}
97
- // expected-note@-1 {{add 'consume' to silence this warning }} {{17-17=consume }}
96
+ restockBorrow ( carrot) // expected-error {{implicit conversion to 'any Veggie & ~Copyable' is consuming}}
97
+ // expected-note@-1 {{add 'consume' to make consumption explicit }} {{17-17=consume }}
98
98
restockBorrow ( consume carrot)
99
99
100
100
restockConsume ( carrot)
101
101
}
102
102
103
103
func genericErasure< T: Veggie & ~ Copyable> ( _ veg: consuming T ) {
104
- restockBorrow ( veg) // expected-warning {{implicit conversion to 'any Veggie & ~Copyable' is consuming}}
105
- // expected-note@-1 {{add 'consume' to silence this warning }} {{17-17=consume }}
104
+ restockBorrow ( veg) // expected-error {{implicit conversion to 'any Veggie & ~Copyable' is consuming}}
105
+ // expected-note@-1 {{add 'consume' to make consumption explicit }} {{17-17=consume }}
106
106
restockBorrow ( consume veg)
107
107
restockBorrow ( veg as any Veggie & ~ Copyable)
108
108
restockConsume ( veg)
@@ -115,12 +115,11 @@ extension Veggie where Self: ~Copyable {
115
115
}
116
116
extension Carrot {
117
117
consuming func check( ) {
118
- inspect ( self ) // expected-warning {{implicit conversion to 'any Veggie & ~Copyable' is consuming}}
119
- // expected-note@-1 {{add 'consume' to silence this warning }} {{13-13=consume }}
118
+ inspect ( self ) // expected-error {{implicit conversion to 'any Veggie & ~Copyable' is consuming}}
119
+ // expected-note@-1 {{add 'consume' to make consumption explicit }} {{13-13=consume }}
120
120
inspect ( consume self)
121
121
inspect ( self as any Veggie & ~ Copyable)
122
122
123
123
let _: any Veggie & ~ Copyable = self
124
124
}
125
125
}
126
-
0 commit comments