Skip to content

Conversation

DougGregor
Copy link
Member

These restrictions will generally manifest as failures of various forms later in the compiler process. Enable the diagnostics to give earlier feedback to help stay within the bounds of Embedded Swift.

Practically speaking, this means we'll diagnose uses of untyped throws in Embedded code bases. This is pretty noisy on the Swift standard library when it builds for Embedded Swift, because it's highlighting the various places where we are either compiling in rethrowing backward-compatibility stubs (I've #if'd out many of these) or we haven't adopted typed throws where we need to.

Fixes rdar://121205043.

…s) in embedded builds

These restrictions will generally manifest as failures of various forms
later in the compiler process. Enable the diagnostics to give earlier
feedback to help stay within the bounds of Embedded Swift.

Fixes rdar://121205043.
Where we have rethrowing versions of functions that have typed-throws
counterparts that are only retained for ABI compatibility, wrap them
in `#if !$Embedded` so they aren't compiled into the Embedded version
of the standard library. This eliminates warnings about this code,
which cannot actually be used with arbitrary errors anyway.
@DougGregor DougGregor requested review from a team, artemcm and tshortli as code owners September 17, 2025 20:12
@DougGregor
Copy link
Member Author

@swift-ci please smoke test

@rauhul rauhul added the embedded Embedded Swift label Sep 17, 2025
@DougGregor
Copy link
Member Author

@swift-ci please smoke test Linux

1 similar comment
@DougGregor
Copy link
Member Author

@swift-ci please smoke test Linux

@DougGregor
Copy link
Member Author

swiftlang/swift-package-manager#9153

@swift-ci please smoke test Linux

@DougGregor DougGregor merged commit 5a46664 into swiftlang:main Sep 18, 2025
3 checks passed
@DougGregor DougGregor deleted the diagnose-untyped-throws-in-embedded branch September 18, 2025 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
embedded Embedded Swift
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants