Skip to content

Commit 73aaf91

Browse files
Merge pull request #72120 from nate-chandler/bitwise-copyable/20240306/1
[BitwiseCopyable] Remove a conformance.
2 parents db237bc + 73231b1 commit 73aaf91

File tree

5 files changed

+17
-13
lines changed

5 files changed

+17
-13
lines changed

stdlib/public/core/Integers.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1902,8 +1902,7 @@ public protocol _LosslessStringConvertibleOrNone {}
19021902
/// customization points for arithmetic operations. When you provide just those
19031903
/// methods, the standard library provides default implementations for all
19041904
/// other arithmetic methods and operators.
1905-
public protocol FixedWidthInteger
1906-
: BinaryInteger, _LosslessStringConvertibleOrNone, _BitwiseCopyable
1905+
public protocol FixedWidthInteger: BinaryInteger, _LosslessStringConvertibleOrNone
19071906
where Magnitude: FixedWidthInteger & UnsignedInteger,
19081907
Stride: FixedWidthInteger & SignedInteger {
19091908
/// The number of bits used for the underlying binary representation of

test/Sema/bitwse_copyable_import.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ struct IntsTrailing3 {
6060
int is[];
6161
} __attribute__((__swift_attr__("_BitwiseCopyable")));
6262

63+
enum E {
64+
foo,
65+
bar
66+
};
67+
6368
//--- Downstream.swift
6469

6570
func take<T : _BitwiseCopyable>(_ t: T) {}
@@ -85,3 +90,7 @@ func passIntsTrailing2(_ t: IntsTrailing2) {
8590
func passIntsTrailing3(_ t: IntsTrailing3) {
8691
take(t)
8792
}
93+
94+
func passE(_ e: E) {
95+
take(e)
96+
}

test/api-digester/Outputs/cake-abi.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1745,13 +1745,6 @@
17451745
"usr": "s:s25LosslessStringConvertibleP",
17461746
"mangledName": "$ss25LosslessStringConvertibleP"
17471747
},
1748-
{
1749-
"kind": "Conformance",
1750-
"name": "_BitwiseCopyable",
1751-
"printedName": "_BitwiseCopyable",
1752-
"usr": "s:s16_BitwiseCopyableP",
1753-
"mangledName": "$ss16_BitwiseCopyableP"
1754-
},
17551748
{
17561749
"kind": "Conformance",
17571750
"name": "SignedNumeric",
@@ -2029,6 +2022,13 @@
20292022
],
20302023
"usr": "s:s10SIMDScalarP",
20312024
"mangledName": "$ss10SIMDScalarP"
2025+
},
2026+
{
2027+
"kind": "Conformance",
2028+
"name": "_BitwiseCopyable",
2029+
"printedName": "_BitwiseCopyable",
2030+
"usr": "s:s16_BitwiseCopyableP",
2031+
"mangledName": "$ss16_BitwiseCopyableP"
20322032
}
20332033
]
20342034
}

test/api-digester/Outputs/stability-stdlib-source-x86_64.swift.expected

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,3 @@ Func withoutActuallyEscaping(_:do:) is now without @rethrows
4848

4949
Protocol SIMDScalar has generic signature change from <Self == Self.SIMD16Storage.Scalar, Self.SIMD16Storage : Swift.SIMDStorage, Self.SIMD2Storage : Swift.SIMDStorage, Self.SIMD32Storage : Swift.SIMDStorage, Self.SIMD4Storage : Swift.SIMDStorage, Self.SIMD64Storage : Swift.SIMDStorage, Self.SIMD8Storage : Swift.SIMDStorage, Self.SIMDMaskScalar : Swift.FixedWidthInteger, Self.SIMDMaskScalar : Swift.SIMDScalar, Self.SIMDMaskScalar : Swift.SignedInteger, Self.SIMD16Storage.Scalar == Self.SIMD2Storage.Scalar, Self.SIMD2Storage.Scalar == Self.SIMD32Storage.Scalar, Self.SIMD32Storage.Scalar == Self.SIMD4Storage.Scalar, Self.SIMD4Storage.Scalar == Self.SIMD64Storage.Scalar, Self.SIMD64Storage.Scalar == Self.SIMD8Storage.Scalar> to <Self : Swift._BitwiseCopyable, Self == Self.SIMD16Storage.Scalar, Self.SIMD16Storage : Swift.SIMDStorage, Self.SIMD2Storage : Swift.SIMDStorage, Self.SIMD32Storage : Swift.SIMDStorage, Self.SIMD4Storage : Swift.SIMDStorage, Self.SIMD64Storage : Swift.SIMDStorage, Self.SIMD8Storage : Swift.SIMDStorage, Self.SIMDMaskScalar : Swift.FixedWidthInteger, Self.SIMDMaskScalar : Swift.SIMDScalar, Self.SIMDMaskScalar : Swift.SignedInteger, Self.SIMDMaskScalar == Self.SIMDMaskScalar.SIMDMaskScalar, Self.SIMD16Storage.Scalar == Self.SIMD2Storage.Scalar, Self.SIMD2Storage.Scalar == Self.SIMD32Storage.Scalar, Self.SIMD32Storage.Scalar == Self.SIMD4Storage.Scalar, Self.SIMD4Storage.Scalar == Self.SIMD64Storage.Scalar, Self.SIMD64Storage.Scalar == Self.SIMD8Storage.Scalar>
5050
Protocol SIMDStorage has generic signature change from <Self.Scalar : Swift.Decodable, Self.Scalar : Swift.Encodable, Self.Scalar : Swift.Hashable> to <Self : Swift._BitwiseCopyable, Self.Scalar : Swift.Decodable, Self.Scalar : Swift.Encodable, Self.Scalar : Swift.Hashable>
51-
Protocol FixedWidthInteger has generic signature change from <Self : Swift.BinaryInteger, Self : Swift.LosslessStringConvertible, Self.Magnitude : Swift.FixedWidthInteger, Self.Magnitude : Swift.UnsignedInteger, Self.Stride : Swift.FixedWidthInteger, Self.Stride : Swift.SignedInteger> to <Self : Swift.BinaryInteger, Self : Swift.LosslessStringConvertible, Self : Swift._BitwiseCopyable, Self.Magnitude : Swift.FixedWidthInteger, Self.Magnitude : Swift.UnsignedInteger, Self.Stride : Swift.FixedWidthInteger, Self.Stride : Swift.SignedInteger>

test/api-digester/stability-stdlib-abi-without-asserts.test

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,5 @@ Protocol SIMDStorage has added inherited protocol _BitwiseCopyable
191191
Protocol SIMDStorage has generic signature change from <Self.Scalar : Swift.Decodable, Self.Scalar : Swift.Encodable, Self.Scalar : Swift.Hashable> to <Self : Swift._BitwiseCopyable, Self.Scalar : Swift.Decodable, Self.Scalar : Swift.Encodable, Self.Scalar : Swift.Hashable>
192192
Protocol _Pointer has added inherited protocol _BitwiseCopyable
193193
Protocol _Pointer has generic signature change from <Self : Swift.CustomDebugStringConvertible, Self : Swift.CustomReflectable, Self : Swift.Hashable, Self : Swift.Strideable> to <Self : Swift.CustomDebugStringConvertible, Self : Swift.CustomReflectable, Self : Swift.Hashable, Self : Swift.Strideable, Self : Swift._BitwiseCopyable>
194-
Protocol FixedWidthInteger has added inherited protocol _BitwiseCopyable
195-
Protocol FixedWidthInteger has generic signature change from <Self : Swift.BinaryInteger, Self : Swift.LosslessStringConvertible, Self.Magnitude : Swift.FixedWidthInteger, Self.Magnitude : Swift.UnsignedInteger, Self.Stride : Swift.FixedWidthInteger, Self.Stride : Swift.SignedInteger> to <Self : Swift.BinaryInteger, Self : Swift.LosslessStringConvertible, Self : Swift._BitwiseCopyable, Self.Magnitude : Swift.FixedWidthInteger, Self.Magnitude : Swift.UnsignedInteger, Self.Stride : Swift.FixedWidthInteger, Self.Stride : Swift.SignedInteger>
196-
197194

198195
// *** DO NOT DISABLE OR XFAIL THIS TEST. *** (See comment above.)

0 commit comments

Comments
 (0)