Instead of suppressing only trait errors that are "exact duplicates",
display only the "most high-level" error when there are multiple trait
errors with the same span that imply each-other.
e.g. when there are both `[closure]: Fn` and `[closure]: FnOnce`, omit
displaying the `[closure]: FnOnce` bound.
Refactor ops.rs
This refactors ops.rs into several different modules internally, as the file has gotten quite big. None of these modules are actually exported, but this should make maintaining it much easier. I've avoided the ambition of exporting the modules because they can more easily be rearranged after this commit goes through, even though it'd be cool to potentially export the modules in the future.
I've separated the creation of each file into a separate commit so that this is easier to read.
Redone version of #42269 with the movement of `RangeArgument` moved.
Build instruction profiler runtime as part of compiler-rt
r? @alexcrichton
This is #38608 with some fixes.
Still missing:
- [x] testing with profiler enabled on some builders (on which ones? Should I add the option to some of the already existing configurations, or create a new configuration?);
- [x] enabling distribution (on which builders?);
- [x] documentation.
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?
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.
Add max and min to Ord
Pursuant to issue #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#25663
Add overflow checking for `str::get` with inclusive ranges
Fixes https://github.com/rust-lang/rust/issues/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)