Skip to content

Commit 05113a6

Browse files
committed
Fixup test case based on limitations of the existing implementation
1 parent 260ade8 commit 05113a6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

test/Unsafe/safe.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ func returnsExistentialP() -> any P {
8787
// expected-note@-1{{@unsafe conformance of 'Int' to protocol 'P' involves unsafe code}}
8888
}
8989

90-
struct UnsafeAsSequence: @unsafe Sequence, IteratorProtocol {
90+
// FIXME: Should work even if the IteratorProtocol conformance is safe
91+
struct UnsafeAsSequence: @unsafe Sequence, @unsafe IteratorProtocol {
9192
mutating func next() -> Int? { nil }
9293
}
9394

@@ -96,6 +97,7 @@ func testUnsafeAsSequenceForEach() {
9697

9798
// expected-warning@+1{{expression uses unsafe constructs but is not marked with 'unsafe'}}{{12-12=unsafe }}
9899
for _ in uas { } // expected-note{{conformance}}
100+
// expected-note@-1{{reference}}
99101

100102
for _ in unsafe uas { } // okay
101103
}

0 commit comments

Comments
 (0)