@@ -19,13 +19,13 @@ func testExplicitCasts() {
1919func testCalls( ) {
2020 let method = MethodSir ( )
2121 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 }}
2424 testBorrowing ( consume foo)
2525 testBorrowing ( foo as NC ? )
2626
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 }}
2929 method. borrow ( consume foo)
3030
3131 testConsuming ( foo)
@@ -59,8 +59,8 @@ func delay(_ f: @autoclosure () -> NC?) -> NC? { f() }
5959
6060func testDelay( ) {
6161 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 }}
6464}
6565
6666struct PropCity {
@@ -74,14 +74,14 @@ struct PropCity {
7474 func chk( _ t: borrowing NC ! ) { }
7575 func chkWithDefaultArg( _ oath: borrowing NC ? = NC ( ) ) { }
7676 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 }}
7979
8080 chk ( consume nc)
8181
8282 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 }}
8585 }
8686}
8787
@@ -93,16 +93,16 @@ func restockConsume(_ x: consuming any Veggie & ~Copyable) {}
9393
9494func checkExistential( ) {
9595 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 }}
9898 restockBorrow ( consume carrot)
9999
100100 restockConsume ( carrot)
101101}
102102
103103func 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 }}
106106 restockBorrow ( consume veg)
107107 restockBorrow ( veg as any Veggie & ~ Copyable)
108108 restockConsume ( veg)
@@ -115,12 +115,11 @@ extension Veggie where Self: ~Copyable {
115115}
116116extension Carrot {
117117 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 }}
120120 inspect ( consume self)
121121 inspect ( self as any Veggie & ~ Copyable)
122122
123123 let _: any Veggie & ~ Copyable = self
124124 }
125125}
126-
0 commit comments