Skip to content
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

Merged
merged 14 commits into from
Jun 14, 2017
Merged

Rollup of 6 pull requests #42644

merged 14 commits into from
Jun 14, 2017

Conversation

scottmcm and others added 14 commits June 4, 2017 01:47
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.
…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?
@rust-highfive
Copy link
Collaborator

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.

@frewsxcv
Copy link
Member Author

@bors r+ p=10

@bors
Copy link
Contributor

bors commented Jun 13, 2017

📌 Commit 9242f22 has been approved by frewsxcv

@arielb1 arielb1 added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Jun 13, 2017
@bors
Copy link
Contributor

bors commented Jun 14, 2017

⌛ Testing commit 9242f22 with merge e40ef96...

bors added a commit that referenced this pull request Jun 14, 2017
Rollup of 6 pull requests

- Successful merges: #42408, #42428, #42496, #42597, #42636, #42638
- Failed merges: #42612
@bors
Copy link
Contributor

bors commented Jun 14, 2017

☀️ Test successful - status-appveyor, status-travis
Approved by: frewsxcv
Pushing e40ef96 to master...

@Centril Centril added the rollup A PR which is a rollup label Oct 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rollup A PR which is a rollup S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants