Skip to content

Commit da92b37

Browse files
committed
[BitwiseCopyable] Loosen validation assertion.
Don't verify triviality of a suppressed conformance.
1 parent 3d54cac commit da92b37

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

lib/SIL/IR/TypeLowering.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3203,7 +3203,8 @@ void TypeConverter::verifyTrivialLowering(const TypeLowering &lowering,
32033203
}
32043204
}
32053205

3206-
if (!lowering.isTrivial() && conformance) {
3206+
if (!lowering.isTrivial() && conformance &&
3207+
!conformance.hasUnavailableConformance()) {
32073208
// A non-trivial type can have a conformance in a few cases:
32083209
// (1) containing or being a conforming archetype
32093210
// (2) is resilient with minimal expansion

test/SILGen/bitwise_copyable.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,11 @@ func pass(_ e: E) { take(e) }
5151
func opacify() -> some _BitwiseCopyable {
5252
return Int()
5353
}
54+
55+
struct NeverGoingToBeBitwiseCopyable {
56+
var a: AnyObject
57+
}
58+
59+
@available(*, unavailable)
60+
extension NeverGoingToBeBitwiseCopyable : _BitwiseCopyable {
61+
}

0 commit comments

Comments
 (0)