| Age | Commit message (Collapse) | Author | Lines |
|
Fix outdated rustdoc of Once::init_locking function
r? @Mark-Simulacrum
related to https://github.com/rust-lang/rust/pull/65979
|
|
Add lint and tests for unnecessary parens around types
This is my first contribution to the Rust project, so I apologize if I'm not doing things the right way.
The PR fixes #64169. It adds a lint and tests for unnecessary parentheses around types. I've run `tidy` and `rustfmt` — I'm not totally sure it worked right, though — and I've tried to follow the instructions linked in the readme.
I tried to think through all the variants of `ast::TyKind` to find exceptions to this lint, and I could only find the one mentioned in the original issue, which concerns types with `dyn`. I'm not a Rust expert, thought, so I may well be missing something.
There's also a problem with getting this to build. The new lint catches several things in the, e.g., `core`. Because `x.py` seems to build with an equivalent of `-Werror`, what would have been warnings cause the build to break. I got it to build and the tests to pass with `--warnings warn` on my `x.py build` and `x.py test` commands.
|
|
|
|
|
|
|
|
Eliminate `intersect_opt`.
Its fourth argument is always `Some(pred)`, so the pattern matching is
unnecessary. This commit inlines and removes it.
r? @nikomatsakis
|
|
|
|
Its fourth argument is always `Some(pred)`, so the pattern matching is
unnecessary. This commit inlines and removes it.
|
|
|
|
|
|
|
|
|
|
|
|
See also https://github.com/rust-lang/rustc-rayon/pull/3
|
|
Fix clippy warnings
* Use `match` instead of `if` chain
* Remove redundant `into_iter()`
* Use `copied()` instead of `map()`
etc.
|
|
Still more `ObligationForest` improvements.
Following on from #64627, more readability improvements, but negligible effects on speed.
r? @nikomatsakis
|
|
|
|
By collecting the done obligations (when necessary) in the main loop.
This makes the code cleaner.
The commit also changes the order in which successful obligations are
returned -- they are now returned in the registered order, rather than
reversed. Because this order doesn't actually matter, being only used by
tests, the commit uses `sort()` to make the test agnostic w.r.t. the
order.
|
|
|
|
|
|
These make the code more concise.
|
|
|
|
They don't help performance at all, and just complicate things.
|
|
|
|
|
|
It has a single call site, and the code is easier to read this way.
|
|
For consistency with other variables in this file.
|
|
It's not necessary; cycles (which are rare) can be detected by looking
at the node stack.
This change speeds things up slightly, as well as simplifying the code a
little.
|
|
|
|
|
|
|
|
|
|
r=michaelwoerister
No StableHasherResult everywhere
This removes the generic parameter on `StableHasher`, instead moving it to the call to `finish`. This has the side-effect of making all `HashStable` impls nicer, since we no longer need the verbose `<W: StableHasherResult>` that previously existed -- often forcing line wrapping.
This is done for two reasons:
* we should avoid false "generic" dependency on the result of StableHasher
* we don't need to codegen two/three copies of all the HashStable impls when they're transitively used to produce a fingerprint, u64, or u128. I haven't measured, but this might actually make our artifacts somewhat smaller too.
* Easier to understand/read/write code -- the result of the stable hasher is irrelevant when writing a hash impl.
|
|
|
|
|
|
StableMap
A wrapper for FxHashMap that allows to insert, remove, get and get_mut
but no iteration support.
StableSet
A wrapper for FxHashSet that allows to insert, remove, get and create a
sorted vector from a hashset but no iteration support.
|
|
Even more `ObligationForest` improvements
Following on from #64545, more speed and readability improvements.
r? @nikomatsakis
|
|
|
|
Because the meaning of this `index` variable is quite different to all
the other `index` variables in this file.
|
|
The name `waiting_cache` sounds like it is related to the states
`NodeState::Waiting`, but it's not; the cache holds nodes of various
states.
This commit changes it to `active_state`.
|
|
We normally use `index` for indices to `ObligationForest::nodes`, but
this is a `Nodes::dependents` index.
|
|
|
|
This is a big speed win for `keccak` and `inflate`.
|
|
This gives a slight speed-up.
|
|
Now that all indices have type `usize`, it makes sense to be more
consistent about their naming. This commit removes all uses of `i` in
favour of `index`.
|
|
The size of the indices doesn't matter much here, and having a
`newtype_index!` index type without also using `IndexVec` requires lots
of conversions. So this commit removes `NodeIndex` in favour of uniform
use of `usize` as the index type. As well as making the code slightly
more concise, it also slightly speeds things up.
|
|
`Node` has an optional parent and a list of other descendents. Most of
the time the parent is treated the same as the other descendents --
error-handling is the exception -- and chaining them together for
iteration has a non-trivial cost.
This commit changes the representation. There is now a single list of
descendants, and a boolean flag that indicates if there is a parent (in
which case it is first descendent). This representation encodes the same
information, in a way that is less idiomatic but cheaper to iterate over
for the common case where the parent doesn't need special treatment.
As a result, some benchmark workloads are up to 2% faster.
|
|
Various `ObligationForest` improvements
These commits make the code both nicer and faster.
r? @nikomatsakis
|
|
Upgrade parking_lot and tempfile rustc dependencies
This should be last piece to unbreak `rustc` in https://github.com/rust-lang/rust/issues/63848
|
|
|