-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Rollup of 6 pull requests #42644
Rollup of 6 pull requests #42644
Conversation
Move any extra logic that the former had into the latter, so they're consistent.
Pursuant to issue rust-lang#25663, this commit adds the max and min functions to the Ord trait, enabling items that implement Ord to use UFCS (ex. 1.max(2)) instead of the longer std::cmp::max(1,2) format.
Add docs to librustc/hir/check_attr.rs Also moved `check_attribute` up to ease reading.
Add overflow checking for `str::get` with inclusive ranges Fixes rust-lang#42401 Two commits here: 1. The first makes `str::index` just call `SliceIndex<str>::index`. It's intended to have no behavior change, except where the two methods were inconsistent. 2. The second actually adds the overflow checking to `get(_mut)` (and tests for it)
…=BurntSushi Add max and min to Ord Pursuant to issue rust-lang#25663, this PR adds max and min methods with default implementations to std::cmp::Ord. It also modifies std::cmp::max|min to internally alias to Ord::max|min, so that any overrides of the default implementations are automatically used by std::cmp::max|min. Closes rust-lang#25663
… r=alexcrichton Capture elapsed duration in Thread::park_timeout example `beginning_park.elapsed()` might return a larger value within the loop as compared to that checked in the loop conditional. Since `Duration` arithmetic is checked, hitting such an edge case will cause a panic.
…2, r=eddyb Add E0617 Part of rust-lang#42229. cc @Susurrus @frewsxcv @QuietMisdreavus
…al, r=petrochenkov Possible mistake in lexer rule for octal integer Original rule allowed for digits 0-8, but octal is 0-7. The compiler correctly prevents you from placing an 8 in an octal, so I'm assuming this is caught on a later stage. Still, shouldn't the lexer already catch this?
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @brson (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. |
@bors r+ p=10 |
📌 Commit 9242f22 has been approved by |
☀️ Test successful - status-appveyor, status-travis |
str::get
with inclusive ranges #42428, Add max and min to Ord #42496, Capture elapsed duration in Thread::park_timeout example #42597, Add E0617 #42636, Possible mistake in lexer rule for octal integer #42638