| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
Run some stuff in parallel
Requires https://github.com/rust-lang/rust/pull/50699 to actually work correctly.
r? @nikomatsakis
|
|
|
|
Declare DebruijnIndex via newtype_index macro
Part of #49887
Declare `DebruijnIndex` via the `newtype_index` macro.
|
|
Add existential type definitions
Note: this does not allow creating named existential types, it just desugars `impl Trait` to a less (but still very) hacky version of actual `existential type` items.
r? @nikomatsakis
|
|
|
|
|
|
|
|
|
|
|
|
Use scope tree depths to speed up `nearest_common_ancestor`.
This patch adds depth markings to all entries in the `ScopeTree`'s
`parent_map`. This change increases memory usage somewhat, but permits a
much faster algorithm to be used:
- If one scope has a greater depth than the other, the deeper scope is
moved upward until they are at equal depths.
- Then we move the two scopes upward in lockstep until they match.
This avoids the need to keep track of which scopes have already been
seen, which was the major part of the cost of the old algorithm. It also
reduces the number of child-to-parent moves (which are hash table
lookups) when the scopes start at different levels, because it never
goes past the nearest common ancestor the way the old algorithm did.
Finally, the case where one of the scopes is the root is now handled in
advance, because that is moderately common and lets us skip everything.
This change speeds up runs of several rust-perf benchmarks, the best by
6%.
A selection of the bigger improvements:
```
clap-rs-check
avg: -2.6% min: -6.6% max: 0.0%
syn-check
avg: -2.2% min: -5.0% max: 0.0%
style-servo-check
avg: -2.9%? min: -4.8%? max: 0.0%?
cargo-check
avg: -1.3% min: -2.8% max: 0.0%
sentry-cli-check
avg: -1.0% min: -2.1% max: 0.0%
webrender-check
avg: -0.9% min: -2.0% max: 0.0%
style-servo
avg: -0.9%? min: -1.8%? max: -0.0%?
ripgrep-check
avg: -0.7% min: -1.8% max: 0.1%
clap-rs
avg: -0.9% min: -1.6% max: -0.2%
regex-check
avg: -0.2% min: -1.3% max: 0.1%
syn
avg: -0.6% min: -1.3% max: 0.1%
hyper-check
avg: -0.5% min: -1.1% max: 0.0%
```
The idea came from multiple commenters on my blog and on Reddit. Thank you!
r? @nikomatsakis
|
|
|
|
|
|
|
|
This patch adds depth markings to all entries in the `ScopeTree`'s
`parent_map`. This change increases memory usage somewhat, but permits a
much faster algorithm to be used:
- If one scope has a greater depth than the other, the deeper scope is
moved upward until they are at equal depths.
- Then we move the two scopes upward in lockstep until they match.
This avoids the need to keep track of which scopes have already been
seen, which was the major part of the cost of the old algorithm. It also
reduces the number of child-to-parent moves (which are hash table
lookups) when the scopes start at different levels, because it never
goes past the nearest common ancestor the way the old algorithm did.
Finally, the case where one of the scopes is the root is now handled in
advance, because that is moderately common and lets us skip everything.
This change speeds up runs of several rust-perf benchmarks, the best by
6%.
|
|
|
|
|
|
|
|
Co-authored-by: csmoe <35686186+csmoe@users.noreply.github.com>
|
|
|
|
|
|
This leads to a lot of simplifications, as most code doesn't actually need to know about the specific lifetime/type data; rather, it's concerned with properties like name, index and def_id.
|
|
|
|
|
|
Fixes #50501
|
|
|
|
|
|
|
|
Move query code outside macros and store query jobs separately from query results
Based on https://github.com/rust-lang/rust/pull/50067
r? @michaelwoerister
|
|
|
|
InternedString
|
|
|
|
|
|
|
|
(rather than issuing multiple errors)
Also, reorder so that the annotations are considered "used" when the
lint runs.
|
|
editions are allowed to be used on non-nightly builds
|
|
Make Handler more thread-safe
The use of `code_emitted` to suppress extended explanations is not thread safe. I'm not sure why we keep the documentation for errors outside `diagnostics.rs` anyway. It would be better to add a `teach` method to `DiagnosticsBuilder`, so instead of:
```
if self.tcx.sess.teach(&err.get_code().unwrap()) {
err.note("...");
}
```
we'd use `err.teach("...")`
cc @estebank
r? @michaelwoerister
|
|
Various rustfmt and commenting changes
These are factored out of #49320
There aren't actually any changes in functionality, just rustfmt and doccomments.
|
|
|
|
|
|
|
|
More thread-safety changes
r? @michaelwoerister
|
|
Prevent broken pipes causing ICEs
As the private `std::io::print_to` panics if there is an I/O error, which is used by `println!`, the compiler would ICE if one attempted to use a broken pipe (e.g. `rustc --help | false`). This introduces a new (private) macro `try_println!` which allows us to avoid this.
As a side note, it seems this macro might be useful publicly (and actually there seems to be [a crate specifically for this purpose](https://crates.io/crates/try_print/)), though that can probably be left for a future discussion.
One slight alternative approach would be to simply early exit without an error (i.e. exit code `0`), which [this comment](https://github.com/rust-lang/rust/issues/34376#issuecomment-377822526) suggests is the usual approach. I've opted not to take that approach initially, because I think it's more helpful to know when there is a broken pipe.
Fixes #34376.
|
|
Skip MIR encoding for cargo check
Resolves #48662.
r? @michaelwoerister
|
|
|
|
r=petrochenkov
Use InternedString rather than Name for RegionParameterDef
This makes it consistent with `TypeParameterDef`.
|
|
This makes it consistent with TypeParameterDef.
|
|
Even more thread-safety changes
r? @michaelwoerister
|
|
Use sort_by_cached_key where appropriate
A follow-up to https://github.com/rust-lang/rust/pull/48639, converting various slice sorting calls to `sort_by_cached_key` when the key functions are more expensive.
|