Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions Sources/FoundationEssentials/URL/URL.swift
Original file line number Diff line number Diff line change
Expand Up @@ -690,18 +690,6 @@ public struct URL: Equatable, Sendable, Hashable {
///
/// Returns `nil` if a `URL` cannot be formed with the string (for example, if the string contains characters that are illegal in a URL, or is an empty string).
public init?(string: __shared String, relativeTo url: __shared URL?) {
#if os(Linux)
// Workaround for a Linux-only crash where swift-corelibs-foundation's
// NSURL.baseURL.getter returns a value of 0x1 when bridging to URL.
// Crash doesn't occur when swift-corelibs-foundation is rebuilt with
// the new swift-foundation URL code, so this is temporary to get
// swift-foundation CI to pass.
if unsafeBitCast(url, to: (UnsafeRawPointer, UnsafeRawPointer).self) == (UnsafeRawPointer(bitPattern: 0x1), UnsafeRawPointer(bitPattern: 0x0)) {
guard let inner = URL._type.init(string: string, relativeTo: nil) else { return nil }
_url = inner.convertingFileReference()
return
}
#endif
guard let inner = URL._type.init(string: string, relativeTo: url) else { return nil }
_url = inner.convertingFileReference()
}
Expand Down