-
Notifications
You must be signed in to change notification settings - Fork 13.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convert rust-analyzer to an in-tree tool #99603
Conversation
fix: typos in hir-ty
…Veykril fix: complete enum variants as patterns in pattern path close rust-lang#12593
fix regressions on assignment expressions This is a follow-up PR on rust-lang#12428. I'm not sure if this is everything I overlooked, so if there are more things that are not right, we may want to revert rust-lang#12428. This should also fix the increase of the type mismatches and the unknown types in diesel in the [metrics](https://rust-analyzer.github.io/metrics/?start=2022-06-23&end=2022-07-01) introduced by rust-lang#12428. The regressions are: - some coercions don't work in the ordinary (i.e. non-destructuring) assignments In order for coercions on ADT fields instantiations to work, lhs type has to be known before inferring rhs. rust-lang#12428 changed the inference order, making rhs inferred before lhs, breaking the coercion, so I restored the original inference mechanism for the ordinary assignments. Note that this kind of coercion doesn't happen in destructuring assigments, because when they are desugared, the struct expression is first assigned to a temporary, which is then assigned to the assignee, which is not coercion site anymore. - type mismatches on individual identifiers are not reported
This change fixes issue rust-lang#10037, in more or less the most naive fashion possible. We continue to start with the hardcoded default of "fun_name", and now append a counter to the end of it if that name is already in scope. In the future, we can probably apply more heuristics here to wind up with more useful names by default, but for now this resolves the immediate problem.
…on-duplicate-name, r=DorianListens fix: Extract Function produces duplicate fn names This change fixes rust-lang#10037, in more or less the most naive fashion possible. We continue to start with the hardcoded default of "fun_name", and now append a counter to the end of it if that name is already in scope. In the future, we can probably apply more heuristics here to wind up with more useful names by default, but for now this resolves the immediate problem.
This change fixes rust-lang#10036, "Extract to function assist implements nonexistent trait methods". When we detect that the extraction is coming from within a trait impl, and that a `self` param will be necessary, we adjust which `SyntaxNode` to `insert_after`, and create a new empty `impl` block for the newly extracted function.
Improve documentation for `buildScripts.overrideCommand` / `checkOnSave.overrideCommand`
@lnicola reports 2 tests still failing: https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Frust-analyzer/topic/git.20subtree.3A.20last.20stretch @bors r- |
@bors r=jyn514 |
☀️ Test successful - checks-actions |
Finished benchmarking commit (3ae03e0): comparison url. Instruction count
Max RSS (memory usage)Results
CyclesResults
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. @rustbot label: -perf-regression Footnotes |
This re-adds
rust-lang/rust-analyzer
as a git subtree rather than a submodule.Closes rust-lang/rust-analyzer#12815.
Prior attempt (research PR): #99465
git rm -f src/tools/rust-analyzer
git subtree add -P src/tools/rust-analyzer https://github.com/rust-lang/rust-analyzer.git master
SourceType::InTree
,rust-analyzer/in-rust-tree
feature when built throughx.py
With this PR, rust-analyzer becomes an "in-tree" tool. Syncs can happen in both directions, see clippy's relevant book section.
Making sure
proc-macro-srv
doesn't break when the proc_macro bridge changes effectively becomes the responsibility ofrust-lang/rust
contributors. These days, that's mostly @mystor, who has been consulted throughout the process. I'm also making myself available in case there's questions / work needed that nobody else signed up for.This doesn't change rust-analyzer's release cycle. After this PR is merged and the next nightly goes out, one can point
rust-analyzer.procMacro.server
to the rustup-providedrust-analyzer
binary. Changes to improve the situation further (auto-discovery/install of the rust-analyzer component) will happen inrust-lang/rust-analyzer
and be synced here eventually.