Skip to content

[stdlib] Unchecked bounds are unsafe #79813

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
merged 2 commits into from
Mar 7, 2025

Conversation

glessard
Copy link
Contributor

@glessard glessard commented Mar 6, 2025

The internal initializers Range.init(_uncheckedBounds:) and ClosedRange.init(_uncheckedBounds:) were skipped over while annotating the standard library for unsafe usage. This fixes that oversight.

@glessard glessard requested a review from a team as a code owner March 6, 2025 02:55
@glessard glessard requested review from DougGregor and removed request for a team March 6, 2025 02:55
@glessard
Copy link
Contributor Author

glessard commented Mar 6, 2025

@swift-ci please smoke test

Copy link
Member

@DougGregor DougGregor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There was a point in my audit where I wasn't marking internal/private things as @unsafe because I was focused on the public API. I think this is the right call---we want to know what the unsafe things are inside the library, too. LGTM

@kperryua
Copy link
Contributor

kperryua commented Mar 6, 2025

swiftlang/swift-package-manager#8336

@swift-ci smoke test Linux

1 similar comment
@kperryua
Copy link
Contributor

kperryua commented Mar 6, 2025

swiftlang/swift-package-manager#8336

@swift-ci smoke test Linux

@glessard
Copy link
Contributor Author

glessard commented Mar 7, 2025

@swift-ci please smoke test linux platform

@glessard glessard enabled auto-merge March 7, 2025 17:01
@glessard glessard merged commit 077a01f into swiftlang:main Mar 7, 2025
3 checks passed
@glessard glessard deleted the unchecked-bounds-are-unsafe branch March 14, 2025 00:19
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.

4 participants