rust-lang / compiler-team

A home for compiler team planning documents, meeting minutes, and other such things.
https://rust-lang.github.io/compiler-team/
Apache License 2.0
387 stars 69 forks source link

Add a `--emit=nameres` for IDEs #749

Closed davidbarsky closed 5 months ago

davidbarsky commented 6 months ago

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 reusing rustc'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:

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:

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.

rustbot commented 6 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

apiraino commented 5 months ago

Closing MCP after discussion on Zulip