Uh oh!
There was an error while loading. Please reload this page.
Docs: Compile-time bounds check in index expression - #25286
Conversation
rust-highfive
commented
May 10, 2015
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. |
bluss
commented
May 10, 2015
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. |
johannhof
commented
May 10, 2015
Right, good catch. I'll try to rephrase. |
steveklabnik
commented
May 10, 2015
yes, http://is.gd/SUUj9T shows this off. |
d8bd5b3 to
022774bCompareThe 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
johannhof
commented
May 10, 2015
Updated. Should explain most cases now. |
bluss
commented
May 10, 2015
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 :-) |
johannhof
commented
May 10, 2015
reassigning ❤️ |
steveklabnik
commented
May 11, 2015
@bors: r+ rollup |
bors
commented
May 11, 2015
📌 Commit 295b62d has been approved by |
steveklabnik
commented
May 11, 2015
Excellent, thanks so much! |
steveklabnik
commented
May 11, 2015
Oh, and you should check in over at #25196, as this means you get to be in AUTHORS. :) |
johannhof
commented
May 11, 2015
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.