You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: test/Unsafe/unsafe-suppression.swift
+8-8Lines changed: 8 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,7 @@ class C {
21
21
22
22
classD1:C{ // expected-note{{make class 'D1' @unsafe to allow unsafe overrides of safe superclass methods}}{{1-1=@unsafe }}
23
23
@unsafe
24
-
overridefunc method(){} // expected-warning{{override of safe instance method with unsafe instance method [Unsafe]}}
24
+
overridefunc method(){} // expected-warning{{override of safe instance method with unsafe instance method [StrictMemorySafety]}}
25
25
}
26
26
27
27
@unsafeclassD2:C{
@@ -34,7 +34,7 @@ protocol P {
34
34
}
35
35
36
36
structS1:P{
37
-
// expected-warning@-1{{conformance of 'S1' to protocol 'P' involves unsafe code; use '@unsafe' to indicate that the conformance is not memory-safe [Unsafe]}}{{12-12=@unsafe }}
37
+
// expected-warning@-1{{conformance of 'S1' to protocol 'P' involves unsafe code; use '@unsafe' to indicate that the conformance is not memory-safe [StrictMemorySafety]}}{{12-12=@unsafe }}
// expected-warning@-1{{conformance of 'S3' to protocol 'P' involves unsafe code; use '@unsafe' to indicate that the conformance is not memory-safe [Unsafe]}}{{15-15=@unsafe }}
51
+
// expected-warning@-1{{conformance of 'S3' to protocol 'P' involves unsafe code; use '@unsafe' to indicate that the conformance is not memory-safe [StrictMemorySafety]}}{{15-15=@unsafe }}
Copy file name to clipboardExpand all lines: test/Unsafe/unsafe.swift
+9-9Lines changed: 9 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ protocol P {
16
16
@unsafefunc g()
17
17
}
18
18
19
-
structXP:P{ // expected-warning{{conformance of 'XP' to protocol 'P' involves unsafe code; use '@unsafe' to indicate that the conformance is not memory-safe [Unsafe]}}{{12-12=@unsafe }}
19
+
structXP:P{ // expected-warning{{conformance of 'XP' to protocol 'P' involves unsafe code; use '@unsafe' to indicate that the conformance is not memory-safe [StrictMemorySafety]}}{{12-12=@unsafe }}
extensionHasAPointerType:Ptrable2{} // expected-note{{unsafe type 'HasAPointerType.Ptr' (aka 'PointerType') cannot satisfy safe associated type 'Ptr'}}
33
-
// expected-warning@-1{{conformance of 'HasAPointerType' to protocol 'Ptrable2' involves unsafe code; use '@unsafe' to indicate that the conformance is not memory-safe [Unsafe]}}{{28-28=@unsafe }}
33
+
// expected-warning@-1{{conformance of 'HasAPointerType' to protocol 'Ptrable2' involves unsafe code; use '@unsafe' to indicate that the conformance is not memory-safe [StrictMemorySafety]}}{{28-28=@unsafe }}
34
34
35
35
structUnsafeXP:@unsafeP{
36
36
@unsafefunc f(){}
@@ -44,7 +44,7 @@ protocol MultiP {
44
44
45
45
structConformsToMultiP{}
46
46
47
-
// expected-warning@+1{{conformance of 'ConformsToMultiP' to protocol 'MultiP' involves unsafe code; use '@unsafe' to indicate that the conformance is not memory-safe [Unsafe]}}{{29-29=@unsafe }}
47
+
// expected-warning@+1{{conformance of 'ConformsToMultiP' to protocol 'MultiP' involves unsafe code; use '@unsafe' to indicate that the conformance is not memory-safe [StrictMemorySafety]}}{{29-29=@unsafe }}
48
48
extensionConformsToMultiP:MultiP{
49
49
// expected-note@-1{{unsafe type 'UnsafeSuper' cannot satisfy safe associated type 'Ptr'}}
50
50
@unsafefunc f()->UnsafeSuper{
@@ -74,7 +74,7 @@ class Super {
74
74
}
75
75
76
76
classSub:Super{ // expected-note{{make class 'Sub' @unsafe to allow unsafe overrides of safe superclass methods}}{{1-1=@unsafe }}
77
-
@unsafeoverridefunc f(){} // expected-warning{{override of safe instance method with unsafe instance method [Unsafe]}}
77
+
@unsafeoverridefunc f(){} // expected-warning{{override of safe instance method with unsafe instance method [StrictMemorySafety]}}
78
78
@unsafeoverridefunc g(){}
79
79
}
80
80
@@ -117,7 +117,7 @@ class ExclusivityChecking {
117
117
func f(){}
118
118
};
119
119
120
-
// expected-warning@+1{{class 'UnsafeSub' has superclass involving unsafe type 'UnsafeSuper' [Unsafe]}}{{1-1=@unsafe }}
120
+
// expected-warning@+1{{class 'UnsafeSub' has superclass involving unsafe type 'UnsafeSuper' [StrictMemorySafety]}}{{1-1=@unsafe }}
let _ =BufferThingy<Int>(count:17) // expected-warning{{expression uses unsafe constructs but is not marked with 'unsafe' [Unsafe]}}{{11-11=unsafe }}
132
+
let _ =BufferThingy<Int>(count:17) // expected-warning{{expression uses unsafe constructs but is not marked with 'unsafe' [StrictMemorySafety]}}{{11-11=unsafe }}
133
133
// expected-note@-1{{reference to unsafe initializer 'init(count:)'}}
134
134
}
135
135
136
136
func testRHS(b:Bool, x:Int){
137
137
@unsafeletlimit=17
138
-
if b && x > limit { // expected-warning{{expression uses unsafe constructs but is not marked with 'unsafe' [Unsafe]}}{{6-6=unsafe }}
138
+
if b && x > limit { // expected-warning{{expression uses unsafe constructs but is not marked with 'unsafe' [StrictMemorySafety]}}{{6-6=unsafe }}
139
139
// expected-note@-1{{reference to unsafe let 'limit'}}
0 commit comments