RangeFrom::step_by docs: fix example#31172
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. Due to 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 the contribution instructions for more information. |
|
The example is now much better, but I am afraid that the overflow behaviour is still not clear. Would this work? |
|
I think discussion of overflow should go into the docs of |
|
Yes, that seems right |
|
Can the |
|
Done. It was probably ignored because it didn’t work :) |
|
@bors: r+ 6e87d781a6eb3dae7014968f60c4ec2b137a9fe4 |
|
http://buildbot.rust-lang.org/builders/auto-linux-64-nopt-t/builds/7783/steps/test/logs/stdio protip: run |
|
⌛ Testing commit 6e87d78 with merge 85ecc8b... |
|
@bors r- force (doctest not yet fixed) |
|
⛄ The build was interrupted to prioritize another pull request. |
The previous example did not do what its description said. In it panicked on integer overflow in debug mode, and went into an infinite loop in release mode (wrapping back to 0 after printing 254).
|
Fixed and tested locally with |
|
@bors r=sfackler |
|
📌 Commit 70d4f26 has been approved by |
The previous example did not do what its description said. In it panicked on integer overflow in debug mode, and went into an infinite loop in release mode (wrapping back to 0 after printing 254).
|
Great! I'll stick it in a rollup since the build for the other PR just started anyway. |
The previous example did not do what its description said. In it panicked on integer overflow in debug mode, and went into an infinite loop in release mode (wrapping back to 0 after printing 254).