@@ -621,41 +621,8 @@ public struct URL : ReferenceConvertible, Equatable {
621
621
public init ( fileURLWithFileSystemRepresentation path: UnsafePointer < Int8 > , isDirectory: Bool , relativeTo baseURL: __shared URL? ) {
622
622
_url = URL . _converted ( from: NSURL ( fileURLWithFileSystemRepresentation: path, isDirectory: isDirectory, relativeTo: baseURL) )
623
623
}
624
-
625
- public var hashValue : Int { // FIXME(hashValue): This should be removed once URL implements Hashable.
626
- return _url. hash
627
- }
628
624
629
- @_alwaysEmitIntoClient // Introduced in 5.1
630
625
public func hash( into hasher: inout Hasher ) {
631
- // We expect this function to eventually satisfy the corresponding
632
- // requirement when URL starts conforming to Hashable. However, in the
633
- // meantime, it is useful to provide it so that user code can simply
634
- // declare the conformance if desired, without implementing anything.
635
- //
636
- // We want this definition to be available to all clients, even those
637
- // that get deployed with the 5.0 Foundation overlay where URL did not
638
- // provide this method. The `@_alwaysEmitIntoClient` attribute above
639
- // forces this function to get compiled into any user code that uses it.
640
- if #available( macOS 9999 , iOS 9999 , tvOS 9999 , watchOS 9999 , * ) {
641
- // When we're on recent enough ABI, we forward the call to the
642
- // resilient implementation provided below. The availability check
643
- // above guarantees that the entry point will exist in the library
644
- // we link with.
645
- _hash ( into: & hasher)
646
- } else {
647
- // This is the hash encoding that gets used with the 5.0 ABI. It has
648
- // to match the version of == implemented by 5.0, so it shouldn't
649
- // ever be changed.
650
- hasher. combine ( _bridgeToObjectiveC ( ) )
651
- }
652
- }
653
-
654
- @usableFromInline
655
- @available ( macOS 9999 , iOS 9999 , tvOS 9999 , watchOS 9999 , * )
656
- internal func _hash( into hasher: inout Hasher ) {
657
- // This code is beyond a resilience boundary. It has to be kept in
658
- // sync with the definition of == implemented below.
659
626
hasher. combine ( _url)
660
627
}
661
628
0 commit comments