Skip to content

[6.2] [Strict memory safety] Adjust "unsafe" location for string interpolation #81911

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

Conversation

DougGregor
Copy link
Member

  • Explanation: String interpolations can end up being unsafe in the call to appendInterpolation when it's provided with unsafe types. Move the location of the proposed "unsafe" out to the string interpolation itself in these cases, which properly suppresses the warning.
  • Scope: Very narrow; impacts the source location of a single warning under strict memory safety.
  • Issues: rdar://151799777
  • Original PRs: [Strict memory safety] Adjust "unsafe" location for string interpolations #81910
  • Risk: Very low.
  • Testing: CI

…ions

String interpolations can end up being unsafe in the call to
appendInterpolation when it's provided with unsafe types. Move the
location of the proposed "unsafe" out to the string interpolation
itself in these cases, which properly suppresses the warning.

Fixes rdar://151799777.
@DougGregor DougGregor requested a review from a team as a code owner June 2, 2025 19:52
@DougGregor
Copy link
Member Author

@swift-ci please test

@DougGregor DougGregor enabled auto-merge June 2, 2025 19:52
@DougGregor DougGregor merged commit 9b62aed into swiftlang:release/6.2 Jun 3, 2025
5 checks passed
@DougGregor DougGregor deleted the unsafe-string-interpolation-6.2 branch June 3, 2025 05:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants