Skip to content

Commit d9a0471

Browse files
committedApr 11, 2025
Update the language for 'Enabling the Swift language feature ...' warnings.
These warnings are nudging developers to adopt features before they become required. They're not just recommendations. Resolves rdar://149086651.
1 parent 41553c1 commit d9a0471

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed
 

‎Sources/SWBCore/SpecImplementations/Tools/SwiftCompiler.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1490,7 +1490,7 @@ public final class SwiftCompilerSpec : CompilerSpec, SpecIdentifierType, SwiftDi
14901490

14911491
switch feature.level {
14921492
case .warn:
1493-
delegate.warning("Enabling the Swift language feature '\(identifier)' is recommended; \(supplementaryMessage)")
1493+
delegate.warning("Enabling the Swift language feature '\(identifier)' will become a requirement in the future; \(supplementaryMessage)")
14941494
case .error:
14951495
delegate.error("Enabling the Swift language feature '\(identifier)' is required; \(supplementaryMessage)")
14961496
case .ignore:

‎Sources/SWBTestSupport/DiagnosticsCheckingResult.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ package func _filterDiagnostic(message: String) -> String? {
202202
return nil
203203
}
204204

205-
if message.hasPrefix("Enabling the Swift language feature 'MemberImportVisibility' is recommended") {
205+
if message.hasPrefix("Enabling the Swift language feature 'MemberImportVisibility' will become a requirement in the future") {
206206
return nil
207207
}
208208

‎Tests/SWBBuildSystemTests/SwiftDriverTests.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -4895,7 +4895,7 @@ fileprivate struct SwiftDriverTests: CoreBasedTests {
48954895
do {
48964896
let params = BuildParameters(configuration: "Debug")
48974897
try await tester.checkBuild(runDestination: .macOS, buildRequest: parameterizedBuildRequest(params)) { results in
4898-
results.checkWarnings([.contains("Enabling the Swift language feature 'DeprecateApplicationMain' is recommended; set 'SWIFT_UPCOMING_FEATURE_DEPRECATE_APPLICATION_MAIN = YES'")], failIfNotFound: true)
4898+
results.checkWarnings([.contains("Enabling the Swift language feature 'DeprecateApplicationMain' will become a requirement in the future; set 'SWIFT_UPCOMING_FEATURE_DEPRECATE_APPLICATION_MAIN = YES'")], failIfNotFound: true)
48994899
results.checkNotes([.contains("Learn more about 'DeprecateApplicationMain' by visiting https://www.swift.org/swift-evolution/")])
49004900
results.checkNoErrors()
49014901
}
@@ -4950,7 +4950,7 @@ fileprivate struct SwiftDriverTests: CoreBasedTests {
49504950
do {
49514951
let params = BuildParameters(configuration: "Debug")
49524952
try await tester.checkBuild(runDestination: .macOS, buildRequest: parameterizedBuildRequest(params)) { results in
4953-
results.checkErrors([.contains("Enabling the Swift language feature 'RegionBasedIsolation' is required; add '-enable-upcoming-feature RegionBasedIsolation' to 'OTHER_SWIFT_FLAGS'")], failIfNotFound: true)
4953+
results.checkErrors([.contains("Enabling the Swift language feature 'RegionBasedIsolation' will become a requirement in the future; add '-enable-upcoming-feature RegionBasedIsolation' to 'OTHER_SWIFT_FLAGS'")], failIfNotFound: true)
49544954
results.checkNotes([.contains("Learn more about 'RegionBasedIsolation' by visiting https://www.swift.org/swift-evolution/")])
49554955
results.checkNoWarnings()
49564956
}

0 commit comments

Comments
 (0)