Skip to content

Commit c56882a

Browse files
xwulorentey
authored andcommitted
[stdlib] Remove unnecessary doc comments from hashValue implementations
When implementing a protocol requirement, additional doc comments are unnecessary unless there are additional semantics peculiar to the specific implementation. The manually propagated documentation had several problems, including copypasta and inconsistent terminology. Therefore, if `T.==` doesn't have any doc comments and the implementation of `T.hashValue` is unremarkable, remove the unnecessary doc comment.
1 parent 4675fc9 commit c56882a

File tree

8 files changed

+2
-46
lines changed

8 files changed

+2
-46
lines changed

stdlib/public/core/Arrays.swift.gyb

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2298,13 +2298,7 @@ extension ${Self} : Equatable where Element : Equatable {
22982298
}
22992299

23002300
@available(swift, introduced: 4.1) // FIXME(conformance-availability)
2301-
extension ${Self}: Hashable where Element : Hashable {
2302-
/// The hash value for the array.
2303-
///
2304-
/// Two arrays that are equal will always have equal hash values.
2305-
///
2306-
/// Hash values are not guaranteed to be equal across different executions of
2307-
/// your program. Do not save hash values to use during a future execution.
2301+
extension ${Self} : Hashable where Element : Hashable {
23082302
@_inlineable // FIXME(sil-serialize-all)
23092303
@available(swift, introduced: 4.1)
23102304
public var hashValue: Int {

stdlib/public/core/ClosedRange.swift

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -386,12 +386,6 @@ extension ClosedRange: Equatable {
386386

387387
@available(swift, introduced: 4.1) // FIXME(conformance-availability)
388388
extension ClosedRange : Hashable where Bound : Hashable {
389-
/// The hash value for the range.
390-
///
391-
/// Two ranges that are equal will always have equal hash values.
392-
///
393-
/// Hash values are not guaranteed to be equal across different executions of
394-
/// your program. Do not save hash values to use during a future execution.
395389
@_inlineable // FIXME(sil-serialize-all)
396390
@available(swift, introduced: 4.1)
397391
public var hashValue: Int {

stdlib/public/core/CollectionOfOne.swift

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -148,12 +148,6 @@ extension CollectionOfOne : Equatable where Element : Equatable {
148148

149149
@available(swift, introduced: 4.1) // FIXME(conformance-availability)
150150
extension CollectionOfOne : Hashable where Element : Hashable {
151-
/// The hash value for the collection.
152-
///
153-
/// Two collection that are equal will always have equal hash values.
154-
///
155-
/// Hash values are not guaranteed to be equal across different executions of
156-
/// your program. Do not save hash values to use during a future execution.
157151
@_inlineable // FIXME(sil-serialize-all)
158152
@available(swift, introduced: 4.1)
159153
public var hashValue: Int {

stdlib/public/core/Dictionary.swift

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1448,12 +1448,6 @@ extension Dictionary: Equatable where Value: Equatable {
14481448

14491449
@available(swift, introduced: 4.1) // FIXME(conformance-availability)
14501450
extension Dictionary: Hashable where Value: Hashable {
1451-
/// The hash value for the dictionary.
1452-
///
1453-
/// Two dictionaries that are equal will always have equal hash values.
1454-
///
1455-
/// Hash values are not guaranteed to be equal across different executions of
1456-
/// your program. Do not save hash values to use during a future execution.
14571451
@_inlineable // FIXME(sil-serialize-all)
14581452
@available(swift, introduced: 4.1)
14591453
public var hashValue: Int {

stdlib/public/core/ExistentialCollection.swift.gyb

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1260,13 +1260,6 @@ extension AnyCollection : Equatable where Element : Equatable {
12601260
12611261
@available(swift, introduced: 4.1) // FIXME(conformance-availability)
12621262
extension AnyCollection : Hashable where Element : Hashable {
1263-
/// The hash value for the collection.
1264-
///
1265-
/// Two `AnyCollection` values that are equal will always have equal hash
1266-
/// values.
1267-
///
1268-
/// Hash values are not guaranteed to be equal across different executions of
1269-
/// your program. Do not save hash values to use during a future execution.
12701263
@_inlineable // FIXME(sil-serialize-all)
12711264
@available(swift, introduced: 4.1)
12721265
public var hashValue: Int {

stdlib/public/core/Mirror.swift

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -777,13 +777,6 @@ extension DictionaryLiteral: Equatable where Key: Equatable, Value: Equatable {
777777

778778
@available(swift, introduced: 4.1) // FIXME(conformance-availability)
779779
extension DictionaryLiteral: Hashable where Key: Hashable, Value: Hashable {
780-
/// The hash value for the collection.
781-
///
782-
/// Two `DictionaryLiteral` values that are equal will always have equal hash
783-
/// values.
784-
///
785-
/// Hash values are not guaranteed to be equal across different executions of
786-
/// your program. Do not save hash values to use during a future execution.
787780
@_inlineable // FIXME(sil-serialize-all)
788781
@available(swift, introduced: 4.1)
789782
public var hashValue: Int {

stdlib/public/core/Optional.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ extension Optional : Equatable where Wrapped : Equatable {
411411

412412
@available(swift, introduced: 4.1) // FIXME(conformance-availability)
413413
extension Optional : Hashable where Wrapped : Hashable {
414-
/// The hash value for the optional.
414+
/// The hash value for the optional instance.
415415
///
416416
/// Two optionals that are equal will always have equal hash values.
417417
///

stdlib/public/core/Range.swift

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -400,12 +400,6 @@ extension Range: Equatable {
400400

401401
@available(swift, introduced: 4.1) // FIXME(conformance-availability)
402402
extension Range : Hashable where Bound : Hashable {
403-
/// The hash value for the range.
404-
///
405-
/// Two ranges that are equal will always have equal hash values.
406-
///
407-
/// Hash values are not guaranteed to be equal across different executions of
408-
/// your program. Do not save hash values to use during a future execution.
409403
@_inlineable // FIXME(sil-serialize-all)
410404
@available(swift, introduced: 4.1)
411405
public var hashValue: Int {

0 commit comments

Comments
 (0)