Skip to content

Commit a477006

Browse files
authored
Merge pull request swiftlang#8884 from apple/clean-up-warnings
2 parents ec0c300 + fc134ae commit a477006

File tree

7 files changed

+20
-18
lines changed

7 files changed

+20
-18
lines changed

stdlib/public/core/CompilerProtocols.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
/// `OptionSet` protocol. Whether using an option set or creating your own,
6262
/// you use the raw value of an option set instance to store the instance's
6363
/// bitfield. The raw value must therefore be of a type that conforms to the
64-
/// `BitwiseOperations` protocol, such as `UInt8` or `Int`. For example, the
64+
/// `FixedWidthInteger` protocol, such as `UInt8` or `Int`. For example, the
6565
/// `Direction` type defines an option set for the four directions you can
6666
/// move in a game.
6767
///
@@ -99,7 +99,7 @@
9999
/// print(allowedMoves.rawValue & Directions.right.rawValue)
100100
/// // Prints "0"
101101
///
102-
/// - SeeAlso: `OptionSet`, `BitwiseOperations`
102+
/// - SeeAlso: `OptionSet`, `FixedWidthInteger`
103103
public protocol RawRepresentable {
104104
/// The raw type that can be used to represent all values of the conforming
105105
/// type.

stdlib/public/core/FixedPoint.swift.gyb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public protocol _Integer
5656
CustomStringConvertible,
5757
Hashable,
5858
IntegerArithmetic,
59-
BitwiseOperations,
59+
_BitwiseOperations,
6060
_Incrementable
6161
{
6262
}
@@ -611,7 +611,7 @@ public func ${op}(lhs: ${Self}, rhs: ${Self}) -> ${Self} {
611611
// Bitwise negate
612612
/// Returns the inverse of the bits set in the argument.
613613
///
614-
/// - SeeAlso: `BitwiseOperations`
614+
/// - SeeAlso: `FixedWidthInteger`
615615
@_transparent
616616
public prefix func ~ (rhs: ${Self}) -> ${Self} {
617617
let mask = ${Self}.subtractWithOverflow(0, 1).0
@@ -657,7 +657,7 @@ public func ${op} (lhs: ${Self}, rhs: ${Self}) -> ${Self} {
657657
% ):
658658
/// Returns the ${comment} the two arguments.
659659
///
660-
/// - SeeAlso: `BitwiseOperations`
660+
/// - SeeAlso: `FixedWidthInteger`
661661
@_transparent
662662
public func ${op} (lhs: ${Self}, rhs: ${Self}) -> ${Self} {
663663
return ${Self}(Builtin.${name}_${BuiltinName}(lhs._value, rhs._value))
@@ -666,15 +666,15 @@ public func ${op} (lhs: ${Self}, rhs: ${Self}) -> ${Self} {
666666
/// Calculates the ${comment} the two arguments
667667
/// and stores the result in the first argument.
668668
///
669-
/// - SeeAlso: `BitwiseOperations`
669+
/// - SeeAlso: `FixedWidthInteger`
670670
@_transparent
671671
public func ${op}=(lhs: inout ${Self}, rhs: ${Self}) {
672672
lhs = lhs ${op} rhs
673673
}
674674
% end
675675

676676
// Bitwise operations
677-
extension ${Self} : BitwiseOperations {
677+
extension ${Self} : FixedWidthInteger {
678678
/// The empty bitset of type `${Self}`.
679679
@_transparent
680680
public static var allZeros: ${Self} { return 0 }

stdlib/public/core/FloatingPoint.swift.gyb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ public protocol FloatingPoint: SignedNumeric, Strideable, Hashable {
171171

172172
// For the minimumMagnitude and maximumMagnitude methods
173173
// FIXME(integers): document me properly
174-
associatedtype Magnitude : Comparable = Self
174+
associatedtype Magnitude = Self
175175

176176
/// A type that represents any written exponent.
177177
associatedtype Exponent: SignedInteger

stdlib/public/core/Integers.swift.gyb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1339,7 +1339,7 @@ extension Numeric {
13391339
/// }
13401340
/// // Prints "23 is greater than -23."
13411341
public protocol BinaryInteger :
1342-
Comparable, Hashable, Numeric, CustomStringConvertible, Strideable {
1342+
Hashable, Numeric, CustomStringConvertible, Strideable {
13431343

13441344
/// A Boolean value indicating whether this type is a signed integer type.
13451345
///
@@ -2009,7 +2009,7 @@ public enum ArithmeticOverflow {
20092009
/// customization points for arithmetic operations. When you provide just those
20102010
/// methods, the standard library provides default implementations for all
20112011
/// other arithmetic methods and operators.
2012-
public protocol FixedWidthInteger : BinaryInteger, BitwiseOperations {
2012+
public protocol FixedWidthInteger : BinaryInteger, _BitwiseOperations {
20132013
/// The number of bits used for the underlying binary representation of
20142014
/// values of this type.
20152015
///

stdlib/public/core/OptionSet.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
///
2222
/// When creating an option set, include a `rawValue` property in your type
2323
/// declaration. The `rawValue` property must be of a type that conforms to
24-
/// the `BitwiseOperations` protocol, such as `Int` or `UInt8`. Next, create
24+
/// the `FixedWidthInteger` protocol, such as `Int` or `UInt8`. Next, create
2525
/// unique options as static properties of your custom type using unique
2626
/// powers of two (1, 2, 4, 8, 16, and so forth) for each individual
2727
/// property's raw value so that each property can be represented by a single
@@ -83,7 +83,7 @@
8383
/// }
8484
/// // Prints "You've earned free priority shipping!"
8585
///
86-
/// - SeeAlso: `BitwiseOperations`, `SetAlgebra`
86+
/// - SeeAlso: `FixedWidthInteger`, `SetAlgebra`
8787
public protocol OptionSet : SetAlgebra, RawRepresentable {
8888
// We can't constrain the associated Element type to be the same as
8989
// Self, but we can do almost as well with a default and a
@@ -307,7 +307,7 @@ extension OptionSet where Element == Self {
307307
}
308308

309309
/// `OptionSet` requirements for which default implementations are
310-
/// supplied when `RawValue` conforms to `BitwiseOperations`,
310+
/// supplied when `RawValue` conforms to `FixedWidthInteger`,
311311
/// which is the usual case. Each distinct bit of an option set's
312312
/// `.rawValue` corresponds to a disjoint value of the `OptionSet`.
313313
///

stdlib/public/core/Policy.swift

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,9 @@ public typealias AnyClass = AnyObject.Type
390390
///
391391
/// - SeeAlso: `OptionSet`
392392
@available(swift, deprecated: 3.1, obsoleted: 4.0, message: "Use FixedWidthInteger protocol instead")
393-
public protocol BitwiseOperations {
393+
typealias BitwiseOperations = _BitwiseOperations
394+
395+
public protocol _BitwiseOperations {
394396
/// Returns the intersection of bits set in the two arguments.
395397
///
396398
/// The bitwise AND operator (`&`) returns a value that has each bit set to
@@ -495,7 +497,7 @@ public protocol BitwiseOperations {
495497
/// - Parameters:
496498
/// - lhs: A value to update with the union of bits set in the two arguments.
497499
/// - rhs: Another value.
498-
public func |= <T : BitwiseOperations>(lhs: inout T, rhs: T) {
500+
public func |= <T : _BitwiseOperations>(lhs: inout T, rhs: T) {
499501
lhs = lhs | rhs
500502
}
501503

@@ -506,7 +508,7 @@ public func |= <T : BitwiseOperations>(lhs: inout T, rhs: T) {
506508
/// - lhs: A value to update with the intersections of bits set in the two
507509
/// arguments.
508510
/// - rhs: Another value.
509-
public func &= <T : BitwiseOperations>(lhs: inout T, rhs: T) {
511+
public func &= <T : _BitwiseOperations>(lhs: inout T, rhs: T) {
510512
lhs = lhs & rhs
511513
}
512514

@@ -517,7 +519,7 @@ public func &= <T : BitwiseOperations>(lhs: inout T, rhs: T) {
517519
/// - lhs: A value to update with the bits that are set in exactly one of the
518520
/// two arguments.
519521
/// - rhs: Another value.
520-
public func ^= <T : BitwiseOperations>(lhs: inout T, rhs: T) {
522+
public func ^= <T : _BitwiseOperations>(lhs: inout T, rhs: T) {
521523
lhs = lhs ^ rhs
522524
}
523525

test/SourceKit/DocSupport/doc_clang_module.swift.response

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6149,7 +6149,7 @@ var FooSubUnnamedEnumeratorA1: Int { get }
61496149
key.description: "Self.RawValue : FixedWidthInteger"
61506150
}
61516151
],
6152-
key.doc.full_as_xml: "<Other><Name></Name><Declaration>extension FooRuncingOptions where Self.RawValue : FixedWidthInteger</Declaration><CommentParts><Abstract><Para><codeVoice>OptionSet</codeVoice> requirements for which default implementations are supplied when <codeVoice>RawValue</codeVoice> conforms to <codeVoice>BitwiseOperations</codeVoice>, which is the usual case. Each distinct bit of an option set’s <codeVoice>.rawValue</codeVoice> corresponds to a disjoint value of the <codeVoice>OptionSet</codeVoice>.</Para></Abstract><Discussion><Note><Para>A type conforming to <codeVoice>OptionSet</codeVoice> can implement any of these initializers or methods, and those implementations will be used in lieu of these defaults.</Para></Note><List-Bullet><Item><Para><codeVoice>union</codeVoice> is implemented as a bitwise “or” (<codeVoice>|</codeVoice>) of <codeVoice>rawValue</codeVoice>s</Para></Item><Item><Para><codeVoice>intersection</codeVoice> is implemented as a bitwise “and” (<codeVoice>&amp;</codeVoice>) of <codeVoice>rawValue</codeVoice>s</Para></Item><Item><Para><codeVoice>symmetricDifference</codeVoice> is implemented as a bitwise “exclusive or” (<codeVoice>^</codeVoice>) of <codeVoice>rawValue</codeVoice>s</Para></Item></List-Bullet></Discussion></CommentParts></Other>",
6152+
key.doc.full_as_xml: "<Other><Name></Name><Declaration>extension FooRuncingOptions where Self.RawValue : FixedWidthInteger</Declaration><CommentParts><Abstract><Para><codeVoice>OptionSet</codeVoice> requirements for which default implementations are supplied when <codeVoice>RawValue</codeVoice> conforms to <codeVoice>FixedWidthInteger</codeVoice>, which is the usual case. Each distinct bit of an option set’s <codeVoice>.rawValue</codeVoice> corresponds to a disjoint value of the <codeVoice>OptionSet</codeVoice>.</Para></Abstract><Discussion><Note><Para>A type conforming to <codeVoice>OptionSet</codeVoice> can implement any of these initializers or methods, and those implementations will be used in lieu of these defaults.</Para></Note><List-Bullet><Item><Para><codeVoice>union</codeVoice> is implemented as a bitwise “or” (<codeVoice>|</codeVoice>) of <codeVoice>rawValue</codeVoice>s</Para></Item><Item><Para><codeVoice>intersection</codeVoice> is implemented as a bitwise “and” (<codeVoice>&amp;</codeVoice>) of <codeVoice>rawValue</codeVoice>s</Para></Item><Item><Para><codeVoice>symmetricDifference</codeVoice> is implemented as a bitwise “exclusive or” (<codeVoice>^</codeVoice>) of <codeVoice>rawValue</codeVoice>s</Para></Item></List-Bullet></Discussion></CommentParts></Other>",
61536153
key.offset: 2502,
61546154
key.length: 247,
61556155
key.extends: {

0 commit comments

Comments
 (0)