Skip to content

Commit 34c1a4d

Browse files
authored
Merge pull request #1341 from swiftlang/automerge/merge-main-2025-06-09_09-01
Merge `main` into `release/6.2`
2 parents 62da7d5 + 2df5199 commit 34c1a4d

24 files changed

+976
-595
lines changed

Benchmarks/Benchmarks/Internationalization/BenchmarkLocale.swift

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,20 @@
1313
import Benchmark
1414
import func Benchmark.blackHole
1515

16-
#if FOUNDATION_FRAMEWORK // This test uses CFString
16+
#if os(macOS) && USE_PACKAGE
17+
import FoundationEssentials
18+
import FoundationInternationalization
19+
#else
1720
import Foundation
21+
#endif
1822

1923
let benchmarks = {
2024
Benchmark.defaultConfiguration.maxIterations = 1_000
2125
Benchmark.defaultConfiguration.maxDuration = .seconds(3)
2226
Benchmark.defaultConfiguration.scalingFactor = .kilo
23-
Benchmark.defaultConfiguration.metrics = [.cpuTotal, .wallClock, .mallocCountTotal, .throughput]
27+
Benchmark.defaultConfiguration.metrics = [.cpuTotal, .wallClock, .throughput, .peakMemoryResident, .peakMemoryResidentDelta]
2428

29+
#if FOUNDATION_FRAMEWORK
2530
let string1 = "aaA" as CFString
2631
let string2 = "AAà" as CFString
2732
let range1 = CFRange(location: 0, length: CFStringGetLength(string1))
@@ -34,5 +39,22 @@ let benchmarks = {
3439
CFStringCompareWithOptionsAndLocale(string1, string2, range1, .init(rawValue: 0), nsLocale)
3540
}
3641
}
37-
}
3842
#endif
43+
44+
let identifiers = Locale.availableIdentifiers
45+
let allComponents = identifiers.map { Locale.Components(identifier: $0) }
46+
Benchmark("LocaleInitFromComponents") { benchmark in
47+
for components in allComponents {
48+
let locale = Locale(components: components)
49+
let components2 = Locale.Components(locale: locale)
50+
let locale2 = Locale(components: components2) // cache hit
51+
}
52+
}
53+
54+
Benchmark("LocaleComponentsInitIdentifer") { benchmark in
55+
for identifier in identifiers {
56+
let components = Locale.Components(identifier: identifier)
57+
}
58+
}
59+
}
60+

CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,13 +111,15 @@ list(APPEND _SwiftFoundation_versions
111111
list(APPEND _SwiftFoundation_availability_names
112112
"FoundationPreview"
113113
"FoundationPredicate"
114-
"FoundationPredicateRegex")
114+
"FoundationPredicateRegex"
115+
"FoundationSpan")
115116

116117
# The aligned availability for each name (in the same order)
117118
list(APPEND _SwiftFoundation_availability_releases
118119
${_SwiftFoundation_BaseAvailability}
119120
${_SwiftFoundation_BaseAvailability}
120-
${_SwiftFoundation_BaseAvailability})
121+
${_SwiftFoundation_BaseAvailability}
122+
${_SwiftFoundation_FutureAvailability})
121123

122124
foreach(version ${_SwiftFoundation_versions})
123125
foreach(name release IN ZIP_LISTS _SwiftFoundation_availability_names _SwiftFoundation_availability_releases)

Package.swift

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ import CompilerPluginSupport
99
let availabilityTags: [_Availability] = [
1010
_Availability("FoundationPreview"), // Default FoundationPreview availability,
1111
_Availability("FoundationPredicate"), // Predicate relies on pack parameter runtime support
12-
_Availability("FoundationPredicateRegex") // Predicate regexes rely on new stdlib APIs
12+
_Availability("FoundationPredicateRegex"), // Predicate regexes rely on new stdlib APIs
13+
_Availability("FoundationSpan", availability: .future), // Availability of Span types
1314
]
1415
let versionNumbers = ["0.1", "0.2", "0.3", "0.4", "6.0.2", "6.1", "6.2"]
1516

@@ -134,6 +135,18 @@ let package = Package(
134135
] + wasiLibcCSettings,
135136
swiftSettings: [
136137
.enableExperimentalFeature("VariadicGenerics"),
138+
.enableExperimentalFeature("LifetimeDependence"),
139+
.enableExperimentalFeature(
140+
"InoutLifetimeDependence",
141+
.when(platforms: [.macOS, .iOS, .watchOS, .tvOS, .linux])
142+
),
143+
.enableExperimentalFeature(
144+
"LifetimeDependenceMutableAccessors",
145+
.when(platforms: [.macOS, .iOS, .watchOS, .tvOS, .linux])
146+
),
147+
.enableExperimentalFeature("AddressableTypes"),
148+
.enableExperimentalFeature("AllowUnsafeAttribute"),
149+
.enableExperimentalFeature("BuiltinModule"),
137150
.enableExperimentalFeature("AccessLevelOnImport")
138151
] + availabilityMacros + featureSettings,
139152
linkerSettings: [
@@ -149,7 +162,16 @@ let package = Package(
149162
resources: [
150163
.copy("Resources")
151164
],
152-
swiftSettings: availabilityMacros + featureSettings
165+
swiftSettings: [
166+
.enableExperimentalFeature(
167+
"InoutLifetimeDependence",
168+
.when(platforms: [.macOS, .iOS, .watchOS, .tvOS, .linux])
169+
),
170+
.enableExperimentalFeature(
171+
"LifetimeDependenceMutableAccessors",
172+
.when(platforms: [.macOS, .iOS, .watchOS, .tvOS, .linux])
173+
),
174+
] + availabilityMacros + featureSettings
153175
),
154176

155177
// FoundationInternationalization

Proposals/0007-swift-subprocess.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Status: **Accepted as 0.1**
77
* Bugs: [rdar://118127512](rdar://118127512), [apple/swift-foundation#309](https://github.com/apple/swift-foundation/issues/309)
88
* Review: [Pitch](https://forums.swift.org/t/pitch-swift-subprocess/69805/65), [1st review](https://forums.swift.org/t/review-sf-0007-introducing-swift-subprocess/70337), [2nd review](https://forums.swift.org/t/review-2nd-sf-0007-subprocess/76547), [3rd review](https://forums.swift.org/t/review-3rd-sf-0007-subprocess/78078/64)
9-
9+
* Implementation: https://github.com/swiftlang/swift-subprocess
1010

1111
## Revision History
1212

Proposals/0014-attributed-string-discontiguous-operations.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* Review Manager: [Tina Liu](https://github.com/itingliu)
66
* Status: **Accepted**
77
* Review: ([Pitch](https://forums.swift.org/t/pitch-attributedstring-discontiguous-operations/76574))
8+
* Implementation: #1145
89

910
## Introduction
1011

Proposals/0017-expanded-calendar-support.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# Expanded calendar support
22

3-
* Proposal: SF-017
3+
* Proposal: SF-0017
44
* Authors: [Dragan Besevic]([email protected])
55
* Review Manager: Tina Liu
6+
* Implementation: https://github.com/swiftlang/swift-foundation/pull/1171
67
* Status: **Accepted**
78

89

Proposals/0021-ISO8601ComponentsStyle.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22

33
* Proposal: SF-0021
44
* Author(s): Tony Parker <[email protected]>
5-
* Status: **Review: March 19, 2025...March 26, 2025**
5+
* Status: **Accepted**
66
* Intended Release: _Swift 6.2_
7+
* Implementation: https://github.com/swiftlang/swift-foundation/pull/1209
78
* Review: ([pitch](https://forums.swift.org/t/pitch-iso8601-components-format-style/77990))
89
*_Related issues_*
910

0 commit comments

Comments
 (0)