Closed davidbarsky closed 5 months ago
This issue is not meant to be used for technical discussion. There is a Zulip stream for that. Use this issue to leave procedural comments, such as volunteering to review, indicating that you second the proposal (or third, etc), or raising a concern that you would like to be addressed.
Concerns or objections to the proposal should be discussed on Zulip and formally registered here by adding a comment with the following syntax:
@rustbot concern reason-for-concern
<description of the concern>
Concerns can be lifted with:
@rustbot resolve reason-for-concern
See documentation at https://forge.rust-lang.org
cc @rust-lang/compiler @rust-lang/compiler-contributors
Proposal
As discussed in this Zulip topic (and several others in
t-compiler/rust-analyzer
), name resolution in rust-analyzer is slow and extremely serial: it gates all IDE functionality until name resolution is completed for the entire dependency graph. While there are several promising avenues for us to improve rust-analyzer's performance without introducing external state, I'm curious how effective reusingrustc
's name resolution results—exposed via an additive--emit=nameres
mode—would be in speeding up rust-analyzer.I don't expect this to be particularly helpful for Cargo-based users of rust-analyzer (as rust-analyzer largely requires the results of a
cargo metadata
execution...), but my employer's usage of Buck2 make this a somewhat viable experiment for two reasons:cargo check
-equivalent build is effectively free for most users (I assume acargo check
is a strict superset of the work required to produce a--emit=nameres
).rust-project.json
(rust-analyzer'scargo-metadata
equivalent for non-Cargo build systems) from Buck is roughly equivalent to running acargo check
for build script/procedural macro reasons.This mode does not need to be stabilized as I can either use a nightly or a
RUSTC_BOOTSTRAP
'd rustc on the stable channel.Mentors or Reviewers
@oli-obk
Process
The main points of the Major Change Process are as follows:
@rustbot second
.-C flag
, then full team check-off is required.@rfcbot fcp merge
on either the MCP or the PR.You can read more about Major Change Proposals on forge.
Comments
This issue is not meant to be used for technical discussion. There is a Zulip stream for that. Use this issue to leave procedural comments, such as volunteering to review, indicating that you second the proposal (or third, etc), or raising a concern that you would like to be addressed.