@@ -71,23 +71,20 @@ import Test
7171import CoreFoundation
7272import CxxStdlib
7373
74- // expected-warning@+3{{global function 'useUnsafeParam' has an interface that involves unsafe types}}
75- // expected-note@+2{{add '@unsafe' to indicate that this declaration is unsafe to use}}{{1-1=@unsafe }}
76- // expected-note@+1{{add '@safe' to indicate that this declaration is memory-safe to use}}{{1-1=@safe }}
77- func useUnsafeParam( x: Unannotated ) { // expected-note{{reference to unsafe struct 'Unannotated'}}
74+ func useUnsafeParam( x: Unannotated ) {
75+ // expected-warning@+1{{expression uses unsafe constructs but is not marked with 'unsafe'}}
76+ _ = x // expected-note{{reference to parameter 'x' involves unsafe type}}
7877}
7978
80- // expected-warning@+4{{global function 'useUnsafeParam2' has an interface that involves unsafe types}}
81- // expected-note@+2{{add '@unsafe' to indicate that this declaration is unsafe to use}}{{1-1=@unsafe }}
82- // expected-note@+1{{add '@safe' to indicate that this declaration is memory-safe to use}}{{1-1=@safe }}
8379@available ( SwiftStdlib 5 . 8 , * )
84- func useUnsafeParam2( x: UnsafeReference ) { // expected-note{{reference to unsafe class 'UnsafeReference'}}
80+ func useUnsafeParam2( x: UnsafeReference ) {
81+ // expected-warning@+1{{expression uses unsafe constructs but is not marked with 'unsafe'}}
82+ _ = x // expected-note{{reference to parameter 'x' involves unsafe type}}
8583}
8684
87- // expected-warning@+3{{global function 'useUnsafeParam3' has an interface that involves unsafe types}}
88- // expected-note@+2{{add '@unsafe' to indicate that this declaration is unsafe to use}}{{1-1=@unsafe }}
89- // expected-note@+1{{add '@safe' to indicate that this declaration is memory-safe to use}}{{1-1=@safe }}
90- func useUnsafeParam3( x: UnknownEscapabilityAggregate ) { // expected-note{{reference to unsafe struct 'UnknownEscapabilityAggregate'}}
85+ func useUnsafeParam3( x: UnknownEscapabilityAggregate ) {
86+ // expected-warning@+1{{expression uses unsafe constructs but is not marked with 'unsafe'}}
87+ _ = x // expected-note{{reference to parameter 'x' involves unsafe type}}
9188}
9289
9390func useSafeParams( x: Owner , y: View , z: SafeEscapableAggregate , c: MyContainer ) {
@@ -101,10 +98,9 @@ func useCfType(x: CFArray) {
10198func useString( x: std . string ) {
10299}
103100
104- // expected-warning@+3{{global function 'useVecOfPtr' has an interface}}
105- // expected-note@+2{{add '@unsafe' to indicate that this declaration is unsafe to use}}{{1-1=@unsafe }}
106- // expected-note@+1{{add '@safe' to indicate that this declaration is memory-safe to use}}{1-1=@safe }}
107- func useVecOfPtr( x: VecOfPtr ) { // expected-note{{reference to unsafe type alias 'VecOfPtr'}}
101+ func useVecOfPtr( x: VecOfPtr ) {
102+ // expected-warning@+1{{expression uses unsafe constructs but is not marked with 'unsafe'}}
103+ _ = x // expected-note{{reference to parameter 'x' involves unsafe type}}
108104}
109105
110106func useVecOfInt( x: VecOfInt ) {
@@ -113,22 +109,19 @@ func useVecOfInt(x: VecOfInt) {
113109func useSafeTuple( x: SafeTuple ) {
114110}
115111
116- // expected-warning@+3{{global function 'useUnsafeTuple' has an interface that involves unsafe types}}
117- // expected-note@+2{{add '@unsafe' to indicate that this declaration is unsafe to use}}{{1-1=@unsafe }}
118- // expected-note@+1{{add '@safe' to indicate that this declaration is memory-safe to use}}{1-1=@safe }}
119- func useUnsafeTuple( x: UnsafeTuple ) { // expected-note{{reference to unsafe type alias 'UnsafeTuple'}}
112+ func useUnsafeTuple( x: UnsafeTuple ) {
113+ // expected-warning@+1{{expression uses unsafe constructs but is not marked with 'unsafe'}}
114+ _ = x // expected-note{{reference to parameter 'x' involves unsafe type}}
120115}
121116
122- // expected-warning@+3{{global function 'useCppSpan' has an interface that involves unsafe types}}
123- // expected-note@+2{{add '@unsafe' to indicate that this declaration is unsafe to use}}{{1-1=@unsafe }}
124- // expected-note@+1{{add '@safe' to indicate that this declaration is memory-safe to use}}{1-1=@safe }}
125- func useCppSpan( x: SpanOfInt ) { // expected-note{{reference to unsafe type alias 'SpanOfInt'}}
117+ func useCppSpan( x: SpanOfInt ) {
118+ // expected-warning@+1{{expression uses unsafe constructs but is not marked with 'unsafe'}}
119+ _ = x // expected-note{{reference to parameter 'x' involves unsafe type}}
126120}
127121
128- // expected-warning@+3{{global function 'useCppSpan2' has an interface that involves unsafe types}}
129- // expected-note@+2{{add '@unsafe' to indicate that this declaration is unsafe to use}}{{1-1=@unsafe }}
130- // expected-note@+1{{add '@safe' to indicate that this declaration is memory-safe to use}}{1-1=@safe }}
131- func useCppSpan2( x: SpanOfIntAlias ) { // expected-note{{reference to unsafe type alias 'SpanOfIntAlias'}}
122+ func useCppSpan2( x: SpanOfIntAlias ) {
123+ // expected-warning@+1{{expression uses unsafe constructs but is not marked with 'unsafe'}}
124+ _ = x // expected-note{{reference to parameter 'x' involves unsafe type}}
132125}
133126
134127func useSafeLifetimeAnnotated( v: View ) {
0 commit comments