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)
```
warning: `<` is interpreted as a start of generic arguments for `usize`, not a comparison
--> $DIR/issue-22644.rs:16:33
|
16 | println!("{}", a as usize < b);
| - ^ interpreted as generic argument
| |
| not interpreted as comparison
|
help: if you want to compare the casted value then write:
| println!("{}", (a as usize) < b);
```
rustdoc: Link directly to associated types
Rather than just linking to the trait.
Also simplifies the logic used to decide whether to render the full
QPath.
rustdoc: Stop stripping empty modules
There is no good reason to strip empty modules with no documentation and
doing so causes subtle problems.
Fixes#42590
* The lazy loading mechanism has been moved to a more appropriate place.
* Return values from the functions invoked there are properly used.
* Documentation has gotten some minor improvements.
* Possibly some larger restructuring will need to take place still.
incr.comp.: Make DepNode `Copy` and valid across compilation sessions
This PR moves `DepNode` to a representation that does not need retracing and thus simplifies comparing dep-graphs from different compilation sessions. The code also gets a lot simpler in many places, since we don't need the generic parameter on `DepNode` anymore. See https://github.com/rust-lang/rust/issues/42294 for details.
~~NOTE: Only the last commit of this is new, the rest is already reviewed in https://github.com/rust-lang/rust/pull/42504.~~
This PR is almost done but there are some things I still want to do:
- [x] Add some module-level documentation to `dep_node.rs`, explaining especially what the `define_dep_nodes!()` macro is about.
- [x] Do another pass over the dep-graph loading logic. I suspect that we can get rid of building the `edges` map and also use arrays instead of hash maps in some places.
cc @rust-lang/compiler
r? @nikomatsakis
Also, I removed the `continue;` statement. I don't think it makes
a difference whether its there or not, but having it there confuses things
when the actual goal was to side-step the assertion in the default case.