-
Notifications
You must be signed in to change notification settings - Fork 18
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
Mark types::Array
indexing as unsafe
#136
Comments
I like the third proposition: it make things explicit, while maintaining readability of the code. |
I do not see how 3 is more readable than 2. Adding an extra I know I'm being stubborn with this one, I just really do not like hiding unsafety. Plus we can keep the current |
Using the 'trick' |
|
I guess the way I see it is "if the Rust team decided that checking bounds only on debug is unsafe, I'll just follow along". |
I we can get to a point where not every access is annotated with |
That's right. |
Ok, I agree with you =) |
Yaaayyy ! |
Just removing the unsafe version did not worked out, so we might want to go the |
Follow-up of #130 (comment).
We have three propositions:
Array2
toUnsafeArray2
andArray3
toUnsafeArray3
, but keep the indexing 'safe'.Index
, and use an unsafeat
methodIndex<Unchecked>
withstruct Unchecked(usize)
The text was updated successfully, but these errors were encountered: