-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Docs: Compile-time bounds check in index expression #25286
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @alexcrichton (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. The way Github handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see CONTRIBUTING.md for more information. |
Consider the case of a runtime value for the index and a fixed size array, then it's checked at run time. Not sure how to explain that in a concise manner. |
Right, good catch. I'll try to rephrase. |
yes, http://is.gd/SUUj9T shows this off. |
d8bd5b3
to
022774b
Compare
The reference was claiming all vectors all bounds-checked at run-time, when constant vectors are usually checked at compile-time. For the changed example see http://is.gd/28ak9E
Updated. Should explain most cases now. |
great. This is all about rust semantics right. I mean, the optimizing part of the compilation may find that it always is out of bounds, and compile that call to panic in statically, but we don't emit any warning or otherwise even notice that :-) |
reassigning ❤️ |
@bors: r+ rollup |
📌 Commit 295b62d has been approved by |
Excellent, thanks so much! |
Oh, and you should check in over at #25196, as this means you get to be in AUTHORS. :) |
yay :D |
The reference was claiming all vectors all bounds-checked at run-time, when constant vectors are usually checked at compile-time. For the changed example see http://is.gd/28ak9E Also fixed a minor grammar issue.
The reference was claiming all vectors all bounds-checked at run-time, when constant vectors are usually checked at compile-time. For the changed example see http://is.gd/28ak9E Also fixed a minor grammar issue.
The reference was claiming all vectors all bounds-checked at run-time, when constant vectors are usually checked at compile-time. For the changed example see http://is.gd/28ak9E Also fixed a minor grammar issue.
The reference was claiming all vectors all bounds-checked at run-time, when constant vectors are usually checked at compile-time.
For the changed example see http://is.gd/28ak9E
Also fixed a minor grammar issue.