Uh oh!
There was an error while loading. Please reload this page.
resolve: Do not build expensive suggestions if they are not actually used - #95255
Conversation
rust-highfive
commented
Mar 24, 2022
(rust-highfive has picked a reviewer for you, use r? to override) |
petrochenkov
commented
Mar 24, 2022
@bors try @rust-timer queue |
rust-timer
commented
Mar 24, 2022
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
bors
commented
Mar 24, 2022
⌛ Trying commit 7e878bb75e2a91159cb6a3f2e4cbabf09fdbb9b1 with merge 5ef703f1b77179a2f29e24ea3e1775a23765725c... |
There was a problem hiding this comment.
This looks like unintended change
There was a problem hiding this comment.
This is a drive-by fix for #94832 (comment) without which Rust doesn't build on my machine.
UPD: submitted as a separate PR in #95266.
bors
commented
Mar 24, 2022
☀️ Try build successful - checks-actions |
rust-timer
commented
Mar 24, 2022
Queued 5ef703f1b77179a2f29e24ea3e1775a23765725c with parent 9f4dc0b, future comparison URL. |
rust-timer
commented
Mar 24, 2022
Finished benchmarking commit (5ef703f1b77179a2f29e24ea3e1775a23765725c): comparison url. Summary: This benchmark run shows 35 relevant improvements 🎉 to instruction counts.
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR led to changes in compiler perf. @bors rollup=never |
There was a problem hiding this comment.
Maybe this enum should have some different name.
It should be short because it's used often.
There are two path resolution modes:
- Speculative mode - we only return the result, but do not report errors or lints, and do not do recovery
- Non-speculative mode - we report errors, do recovery when possible, also report lints, and mark path targets as used (the
record_usednaming comes from this). That's why need some extra data like a node id for linting or a span in this mode.
Maybe call it enum Finalize?
It's two letters shorter, not as specific as the old "record used" naming, and we use "finalize" elsewhere in resolve for similar functionality, like fn finalize_(imports,macro_resolutions).
There was a problem hiding this comment.
Maybe something like
enumMode{Speculative,Finalize}?
enum Finalize looks OK to me though.
There was a problem hiding this comment.
I've renamed everything to Finalize/finalize, but kept it a single flat enum (with Finalize::No variant), otherwise it becomes too annoying to both construct and unwrap it.
michaelwoerister
commented
Mar 24, 2022
Let me know when this is ready for review 👍 |
petrochenkov
commented
Mar 24, 2022
@michaelwoerister |
michaelwoerister
commented
Mar 24, 2022
This looks like some great cleanup work. Lots of duplicate error messages being removed too. |
…used Also remove a redundant parameter from `fn resolve_path(_with_ribs)`, `crate_lint: CrateLint` is a more detailed version of `record_used: bool` with `CrateLint::No` meaning `false` and anything else meaning `true`.
Do not construct or pass unused data
And `crate_lint`/`record_used` to `finalize`
petrochenkov
commented
Mar 24, 2022
No, nothing too deep happens here, I mostly wanted some second opinion on naming. |
michaelwoerister
commented
Mar 25, 2022
OK, looks good to me. |
bors
commented
Mar 25, 2022
📌 Commit 1ad64a2 has been approved by |
bors
commented
Mar 25, 2022
bors
commented
Mar 25, 2022
☀️ Test successful - checks-actions |
rust-timer
commented
Mar 25, 2022
Finished benchmarking commit (903427b): comparison url. Summary: This benchmark run shows 33 relevant improvements 🎉 to instruction counts.
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. @rustbot label: -perf-regression |
resolve: Cleanup path resolution finalization Some cleanup after rust-lang#95255 and rust-lang#95405. r? `@cjgillot`
And remove a bunch of (conditionally) unused parameters from path resolution functions.
This helps with performance issues in #94857, and should be helpful in general even without that.