Skip to content

Gardening: Migrate stdlib sources to GH issues #61289

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
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
9 changes: 5 additions & 4 deletions stdlib/cmake/modules/AddSwiftStdlib.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -1917,10 +1917,11 @@ function(add_swift_target_library name)
list(APPEND swiftlib_swift_compile_flags_all
${SWIFTLIB_SWIFT_COMPILE_FLAGS_LINUX})
elseif(${sdk} STREQUAL WINDOWS)
# FIXME(SR2005) static and shared are not mutually exclusive; however
# since we do a single build of the sources, this doesn't work for
# building both simultaneously. Effectively, only shared builds are
# supported on windows currently.
# FIXME: https://github.com/apple/swift/issues/44614
# static and shared are not mutually exclusive; however since we do a
# single build of the sources, this doesn't work for building both
# simultaneously. Effectively, only shared builds are supported on
# windows currently.
if(SWIFTLIB_SHARED)
list(APPEND swiftlib_swift_compile_flags_all -D_WINDLL)
if(SWIFTLIB_IS_STDLIB_CORE)
Expand Down
2 changes: 1 addition & 1 deletion stdlib/public/SwiftShims/swift/shims/RefCount.h
Original file line number Diff line number Diff line change
Expand Up @@ -1326,7 +1326,7 @@ class HeapObjectSideTableEntry {
public:
HeapObjectSideTableEntry(HeapObject *newObject)
: object(newObject),
#if __arm__ || __powerpc__ // https://bugs.swift.org/browse/SR-5846
#if __arm__ || __powerpc__ // https://github.com/apple/swift/issues/48416
refCounts(SideTableRefCounts::Initialized)
#else
refCounts()
Expand Down
2 changes: 1 addition & 1 deletion stdlib/public/core/ArrayShared.swift
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ extension Collection {
}

extension _ArrayBufferProtocol {
@inlinable // FIXME @useableFromInline https://bugs.swift.org/browse/SR-7588
@inlinable // FIXME: @useableFromInline (https://github.com/apple/swift/issues/50130).
@inline(never)
internal mutating func _arrayOutOfPlaceReplace<C: Collection>(
_ bounds: Range<Int>,
Expand Down
2 changes: 1 addition & 1 deletion stdlib/public/core/CTypes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public typealias CLongDouble = Double
#endif
#elseif os(Android)
// On Android, long double is Float128 for AAPCS64, which we don't have yet in
// Swift (SR-9072); and Double for ARMv7.
// Swift (https://github.com/apple/swift/issues/51573); and Double for ARMv7.
#if arch(arm)
public typealias CLongDouble = Double
#endif
Expand Down
2 changes: 1 addition & 1 deletion stdlib/public/core/CompilerProtocols.swift
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ extension RawRepresentable where RawValue: Hashable, Self: Hashable {
// so code that used to work in 5.0 remains working whether or not the
// original definition was inlined.
//
// See https://bugs.swift.org/browse/SR-10734
// See https://github.com/apple/swift/issues/53126.
var hasher = Hasher(_seed: seed)
self.hash(into: &hasher)
return hasher._finalize()
Expand Down
3 changes: 2 additions & 1 deletion stdlib/public/core/Filter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,11 @@ public typealias LazyFilterCollection<T: Collection> = LazyFilterSequence<T>
extension LazyFilterCollection: Collection {
public typealias SubSequence = LazyFilterCollection<Base.SubSequence>

// https://github.com/apple/swift/issues/46747
// Any estimate of the number of elements that pass `_predicate` requires
// iterating the collection and evaluating each element, which can be costly,
// is unexpected, and usually doesn't pay for itself in saving time through
// preventing intermediate reallocations. (SR-4164)
// preventing intermediate reallocations.
@inlinable // lazy-performance
public var underestimatedCount: Int { return 0 }

Expand Down
2 changes: 1 addition & 1 deletion stdlib/public/core/FloatingPointTypes.swift.gyb
Original file line number Diff line number Diff line change
Expand Up @@ -952,7 +952,7 @@ extension ${Self}: _ExpressibleByBuiltinFloatLiteral {
% if bits == builtinFloatLiteralBits:
self = ${Self}(value)
% elif bits < builtinFloatLiteralBits:
// FIXME: This can result in double rounding errors (SR-7124).
// FIXME: This can result in double rounding errors (https://github.com/apple/swift/issues/49672).
self = ${Self}(Builtin.fptrunc_FPIEEE${builtinFloatLiteralBits}_FPIEEE${bits}(value))
% else:
// FIXME: This is actually losing precision <rdar://problem/14073102>.
Expand Down
4 changes: 2 additions & 2 deletions stdlib/public/core/HashTable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ extension _HashTable {
) -> Int {
// We generate a new hash seed whenever a new hash table is allocated and
// whenever an existing table is resized, so that we avoid certain copy
// operations becoming quadratic. (For background details, see
// https://bugs.swift.org/browse/SR-3268)
// operations becoming quadratic. For background details, see
// https://github.com/apple/swift/issues/45856.
//
// Note that we do reuse the existing seed when making copy-on-write copies
// so that we avoid breaking value semantics.
Expand Down
9 changes: 3 additions & 6 deletions stdlib/public/core/Mirror.swift
Original file line number Diff line number Diff line change
Expand Up @@ -482,8 +482,7 @@ public struct Mirror {
displayStyle: DisplayStyle? = nil,
ancestorRepresentation: AncestorRepresentation = .generated
) where C.Element == Child {
// Can't use Builtin.unreachable() due to
// https://bugs.swift.org/browse/SR-15300
// FIXME: Can't use Builtin.unreachable() due to https://github.com/apple/swift/issues/57622.
self.init(reflecting: subject)
}
public init<Subject, C: Collection>(
Expand All @@ -492,8 +491,7 @@ public struct Mirror {
displayStyle: DisplayStyle? = nil,
ancestorRepresentation: AncestorRepresentation = .generated
) {
// Can't use Builtin.unreachable() due to
// https://bugs.swift.org/browse/SR-15300
// FIXME: Can't use Builtin.unreachable() due to https://github.com/apple/swift/issues/57622.
self.init(reflecting: subject)
}
public init<Subject>(
Expand All @@ -502,8 +500,7 @@ public struct Mirror {
displayStyle: DisplayStyle? = nil,
ancestorRepresentation: AncestorRepresentation = .generated
) {
// Can't use Builtin.unreachable() due to
// https://bugs.swift.org/browse/SR-15300
// FIXME: Can't use Builtin.unreachable() due to https://github.com/apple/swift/issues/57622.
self.init(reflecting: subject)
}
public let subjectType: Any.Type
Expand Down
2 changes: 1 addition & 1 deletion stdlib/public/core/SliceBuffer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ internal struct _SliceBuffer<Element>
//
// return _hasNativeBuffer && isUniquelyReferenced()
//
// SR-6437
// https://github.com/apple/swift/issues/48987
if !_hasNativeBuffer {
return false
}
Expand Down
12 changes: 8 additions & 4 deletions stdlib/public/core/Sort.swift
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,8 @@ extension MutableCollection where Self: BidirectionalCollection {
/// as out-of-place storage. Stable.
///
/// The unused return value is legacy ABI. It was originally added as a
/// workaround for a compiler bug (now fixed). See SR-14750 (rdar://45044610).
/// workaround for a compiler bug (now fixed). See
/// https://github.com/apple/swift/issues/57100 (rdar://45044610).
///
/// - Precondition: `lo..<mid` and `mid..<hi` must already be sorted according
/// to `areInIncreasingOrder`.
Expand Down Expand Up @@ -515,7 +516,8 @@ extension UnsafeMutableBufferPointer {
/// out-of-place storage.
///
/// The unused return value is legacy ABI. It was originally added as a
/// workaround for a compiler bug (now fixed). See SR-14750 (rdar://45044610).
/// workaround for a compiler bug (now fixed). See
/// https://github.com/apple/swift/issues/57100 (rdar://45044610).
///
/// - Precondition: `runs.count > 1` and `i > 0`
/// - Precondition: `buffer` must have at least
Expand Down Expand Up @@ -551,7 +553,8 @@ extension UnsafeMutableBufferPointer {
/// satisfied.
///
/// The unused return value is legacy ABI. It was originally added as a
/// workaround for a compiler bug (now fixed). See SR-14750 (rdar://45044610).
/// workaround for a compiler bug (now fixed). See
/// https://github.com/apple/swift/issues/57100 (rdar://45044610).
///
/// - Precondition: `buffer` must have at least
/// `min(runs[i].count, runs[i - 1].count)` uninitialized elements.
Expand Down Expand Up @@ -628,7 +631,8 @@ extension UnsafeMutableBufferPointer {
/// Merges elements of `runs` until only one run remains.
///
/// The unused return value is legacy ABI. It was originally added as a
/// workaround for a compiler bug (now fixed). See SR-14750 (rdar://45044610).
/// workaround for a compiler bug (now fixed). See
/// https://github.com/apple/swift/issues/57100 (rdar://45044610).
///
/// - Precondition: `buffer` must have at least
/// `min(runs[i].count, runs[i - 1].count)` uninitialized elements.
Expand Down
4 changes: 2 additions & 2 deletions stdlib/public/core/Stride.swift
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ extension StrideTo: CustomReflectable {
}
#endif

// FIXME(conditional-conformances): This does not yet compile (SR-6474).
// FIXME(conditional-conformances): This does not yet compile (https://github.com/apple/swift/issues/49024).
#if false
extension StrideTo: RandomAccessCollection
where Element.Stride: BinaryInteger {
Expand Down Expand Up @@ -616,7 +616,7 @@ extension StrideThrough: CustomReflectable {
}
#endif

// FIXME(conditional-conformances): This does not yet compile (SR-6474).
// FIXME(conditional-conformances): This does not yet compile (https://github.com/apple/swift/issues/49024).
#if false
extension StrideThrough: RandomAccessCollection
where Element.Stride: BinaryInteger {
Expand Down
6 changes: 3 additions & 3 deletions stdlib/public/core/StringComparable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ extension String: Comparable {

extension Substring: Equatable {}

// TODO(SR-12457): Generalize `~=` over `StringProtocol`. Below are
// concrete overloads to give us most of the benefit without potential harm
// to expression type checking performance.
// TODO: Generalize `~=` over `StringProtocol` (https://github.com/apple/swift/issues/54896)
// Below are concrete overloads to give us most of the benefit without potential
// harm to expression type checking performance.
extension String {
@_alwaysEmitIntoClient
@inline(__always)
Expand Down
8 changes: 4 additions & 4 deletions stdlib/public/core/StringRangeReplaceableCollection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -339,15 +339,15 @@ extension String {
}

extension String {
// This is needed because of the issue described in SR-4660 which causes
// source compatibility issues when String becomes a collection
// FIXME: This is needed because of https://github.com/apple/swift/issues/47237,
// which causes source compatibility issues when String becomes a collection.
@_transparent
public func max<T: Comparable>(_ x: T, _ y: T) -> T {
return Swift.max(x,y)
}

// This is needed because of the issue described in SR-4660 which causes
// source compatibility issues when String becomes a collection
// FIXME: This is needed because of https://github.com/apple/swift/issues/47237,
// which causes source compatibility issues when String becomes a collection.
@_transparent
public func min<T: Comparable>(_ x: T, _ y: T) -> T {
return Swift.min(x,y)
Expand Down
14 changes: 8 additions & 6 deletions stdlib/public/runtime/DynamicCast.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -786,12 +786,14 @@ tryCastToAnyHashable(
#endif
}
case MetadataKind::Optional: {
// Until SR-9047 fixes the interactions between AnyHashable and Optional, we
// avoid directly injecting Optionals. In particular, this allows
// casts from [String?:String] to [AnyHashable:Any] to work the way people
// expect. Otherwise, without SR-9047, the resulting dictionary can only be
// indexed with an explicit Optional<String>, not a plain String.
// After SR-9047, we can consider dropping this special case entirely.
// FIXME: https://github.com/apple/swift/issues/51550
// Until the interactions between AnyHashable and Optional is fixed, we
// avoid directly injecting Optionals. In particular, this allows casts
// from [String?:String] to [AnyHashable:Any] to work the way people
// expect. Otherwise, the resulting dictionary can only be indexed with an
// explicit Optional<String>, not a plain String.
// After fixing the issue, we can consider dropping this special
// case entirely.

// !!!! This breaks compatibility with compiler-optimized casts
// (which just inject) and violates the Casting Spec. It just preserves
Expand Down
6 changes: 2 additions & 4 deletions stdlib/public/runtime/Exclusivity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@ static inline void _flockfile_stderr() {
#if defined(_WIN32)
_lock_file(stderr);
#elif defined(__wasi__)
// WebAssembly/WASI doesn't support file locking yet
// https://bugs.swift.org/browse/SR-12097
// FIXME: WebAssembly/WASI doesn't support file locking yet (https://github.com/apple/swift/issues/54533).
#else
flockfile(stderr);
#endif
Expand All @@ -86,8 +85,7 @@ static inline void _funlockfile_stderr() {
#if defined(_WIN32)
_unlock_file(stderr);
#elif defined(__wasi__)
// WebAssembly/WASI doesn't support file locking yet
// https://bugs.swift.org/browse/SR-12097
// FIXME: WebAssembly/WASI doesn't support file locking yet (https://github.com/apple/swift/issues/54533).
#else
funlockfile(stderr);
#endif
Expand Down
2 changes: 1 addition & 1 deletion stdlib/public/runtime/Metadata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1498,7 +1498,7 @@ class TupleCacheEntry
class TupleCacheStorage :
public LockingConcurrentMapStorage<TupleCacheEntry, TupleCacheTag> {
public:
// FIXME: https://bugs.swift.org/browse/SR-1155
// FIXME: https://github.com/apple/swift/issues/43763.
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
static TupleCacheEntry *
Expand Down
3 changes: 2 additions & 1 deletion stdlib/public/runtime/SwiftObject.mm
Original file line number Diff line number Diff line change
Expand Up @@ -1272,7 +1272,8 @@ id swift_dynamicCastObjCProtocolConditional(id object,
// class "c" might be valid metadata, but it hasn't been initialized yet.
// Send a message that's likely not to be overridden to minimize potential
// side effects. Ignore the return value in case it is overridden to
// return something different. See SR-10463 for an example.
// return something different. See
// https://github.com/apple/swift/issues/52863 for an example.
[c self];
return c;
}
Expand Down
4 changes: 2 additions & 2 deletions stdlib/public/stubs/Stubs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ void _swift_stdlib_flockfile_stdout() {
#if defined(_WIN32)
_lock_file(stdout);
#elif defined(__wasi__)
// WebAssembly/WASI doesn't support file locking yet https://bugs.swift.org/browse/SR-12097
// FIXME: WebAssembly/WASI doesn't support file locking yet (https://github.com/apple/swift/issues/54533).
#else
flockfile(stdout);
#endif
Expand All @@ -471,7 +471,7 @@ void _swift_stdlib_funlockfile_stdout() {
#if defined(_WIN32)
_unlock_file(stdout);
#elif defined(__wasi__)
// WebAssembly/WASI doesn't support file locking yet https://bugs.swift.org/browse/SR-12097
// FIXME: WebAssembly/WASI doesn't support file locking yet (https://github.com/apple/swift/issues/54533).
#else
funlockfile(stdout);
#endif
Expand Down