-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Sync rust-analyzer
, add rust-analyzer-proc-macro-srv
binary to Rustc component
#99756
Sync rust-analyzer
, add rust-analyzer-proc-macro-srv
binary to Rustc component
#99756
Conversation
- use `path` instead of `paths` - don't mark rust-analyzer as an optional tool - print the cargo command that's run in the proc-macro-test build script this originally was part of a change to fix `test --stage 0 rust-analyzer`, but I'm going to leave that for a separate PR so it's easier to review.
…gen, r=Veykril fix: don't replace default members' body cc rust-lang#12779, rust-lang#12821 addresses rust-lang/rust-analyzer#12821 (comment) `gen_trait_fn_body()` only attempts to implement required trait member functions, so we shouldn't call it for `Implement default members` assist. This patch also documents the precondition of `gen_trait_fn_body()` and inserts `debug_assert!`, but I'm not entirely sure if the assertions are appropriate.
…on order isn't guaranteed (And, in fact, it failed on i686)
…ing-assignment, r=Veykril Fix missing fields check on destructuring assignment Fixes rust-lang#12838 When checking if the record literal in question is an assignee expression or not, the new fn `is_assignee_record_literal` iterates over its ancestors until it is sure. This isn't super efficient, as we don't cache anything and does the iteration for every record literal during missing fields check. Alternatively, we may want to have a field like `assignee` on `hir_def::Expr::{RecordLit, Array, Tuple, Call}` to tell if it's an assignee expression, which would be O(1) when checking later but have some memory overhead for the field.
…, r=DorianListens fix: Autocomplete for struct fields includes receiver fixes rust-lang#12857
Replace `debug_assert!` with `stdx::always!` Addresses rust-lang/rust-analyzer#12832 (comment)
feat: Spawn a proc-macro-srv instance per workspace cc rust-lang/rust-analyzer#12855 The idea is to have each server be spawned with the appropriate toolchain, that way workspaces with differing toolchains shouldn't suffer from proc-macro abi mismatches.
…ykril Sync from `rust-lang/rust` This is the first subtree sync PR from `rust-lang/rust` to `rust-lang/rust-analyzer`, made by following the instructions at: https://doc.rust-lang.org/nightly/clippy/development/infrastructure/sync.html#performing-the-sync-from-rust-langrust-to-clippy It includes all the commits that were made in: * rust-lang#99603 (And that were reviewed ahead of time by `@Veykril` + `@lnicola)`
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
…, start looking in there for a rust-analyzer-proc-macro-srv binary
Ok, so! I added $ ./x.py dist rustc
(cut)
$ tar wtf build/dist/rustc-1.64.0-dev-x86_64-unknown-linux-gnu.tar.gz | sed -n 's/rustc-[^/]*\/rustc//p' | grep proc-macro-srv
/libexec/rust-analyzer-proc-macro-srv Things that bother me are:
|
@rustbot review |
This comment has been minimized.
This comment has been minimized.
Try setting |
Does that mean we don't need a separate |
Nope, that one builds |
I made the two bootstrap tests pass in e075003 but I'm not sure if:
These lines I don't feel super confident about: |
rust-analyzer
rust-analyzer
, add rust-analyzer-proc-macro-srv
binary to Rustc component
If possible, please squash the bootstrap-related commits into just one, and then I'm happy to r+ Thanks! |
This builds `src/tools/rust-analyzer/crates/proc-macro-srv-cli` and ships it as part of Rustc's dist component. This allows rust-analyzer's proc macro support to work on all rustc versions (stable, beta and nightly) starting now.
87ae3c0
to
6ea7d82
Compare
@Mark-Simulacrum All done! I went as far as doing an ❯ tar wtf .\build\dist\rustc-1.64.0-dev-x86_64-pc-windows-msvc.tar.gz | grep proc-macro-srv
rustc-1.64.0-dev-x86_64-pc-windows-msvc/rustc/libexec/rust-analyzer-proc-macro-srv.exe |
@bors r+ rollup=iffy |
☀️ Test successful - checks-actions |
Finished benchmarking commit (05e678c): comparison url. Instruction countThis benchmark run did not return any relevant results for this metric. 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 |
As discussed earlier with @jyn514 and @pietroalbini, I'm also going to use this PR to have
dist::Rustc
build therust-analyzer-proc-macro-srv
binary introduced in:rust-lang/rust
rust-analyzer#12871