Skip to content

Conversation

@DougGregor
Copy link
Member

In the effects checker, we were propagating the "has an unsafe use site" outside of an unsafe expression. The result of this is that we would not produce a warning for silly expressions like unsafe unsafe ptr.pointee, where the first (outer) unsafe is unnecessary. Stop propagating that bit so we properly diagnose the spurious "unsafe".

Fixes issue #82315 / rdar://153672668.

…tward

In the effects checker, we were propagating the "has an unsafe use
site" outside of an `unsafe` expression. The result of this is that we
would not produce a warning for silly expressions like `unsafe unsafe
ptr.pointee`, where the first (outer) `unsafe` is unnecessary. Stop
propagating that bit so we properly diagnose the spurious "unsafe".

Fixes issue swiftlang#82315 / rdar://153672668.
@DougGregor
Copy link
Member Author

@swift-ci please smoke test

@DougGregor
Copy link
Member Author

@swift-ci please smoke test macOS

@DougGregor DougGregor merged commit dbbdfce into swiftlang:main Jul 17, 2025
3 checks passed
@DougGregor DougGregor deleted the unsafe-covers-unsafe branch July 17, 2025 05:02
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