Skip to content

⬆️ rust-analyzer #103177

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

Merged
merged 94 commits into from
Oct 18, 2022
Merged

⬆️ rust-analyzer #103177

merged 94 commits into from
Oct 18, 2022

Conversation

lnicola
Copy link
Member

@lnicola lnicola commented Oct 18, 2022

r? @ghost

feniljain and others added 30 commits September 15, 2022 17:22
VS Code problem matcher are restricted to be static "regexes". You can't
create a problem matcher dynamically, and you can't use custom code in
lieu of problem matcher.

This creates a problem for rust/cargo compiler errors. They use paths
relative to the root of the Cargo workspace, but VS Code doesn't
necessary know where that root is.

Luckily, there's a way out: our current problem matcher is defined like
this:

    "fileLocation": [ "autoDetect", "${workspaceRoot}" ],

That means that relative pahts would be resoleved relative to workspace
root. VS Code allows to specify a command inside `${}`. So we can plug
custom logic there to fetch Cargo's workspace root!

And that's exactly what this PR is doing!
Also includes a drive-by refactor of `utils::generate_impl_text_inner`,
since that's what drove this change
…defaults, r=Veykril

internal: Add `GenericParamList::to_generic_args` and `{TypeParam,ConstParam}::remove_default` APIs

Also fixes `generate_impl` not removing the default const param value, though it seems that no one has encountered or reported that issue yet 😅

This initially started out as refactoring `utils::generate_impl_text_inner` to understand it better (which was the reason for adding `{TypeParam,ConstParam}::remove_default`), but ended up also finding another place that needed `GenericParamList::to_generic_args`, hence its addition in here.
… r=Veykril

fix: Underline only the intra-doc link itself instead of the whole doc comment
fix: in VSCode, correctly resolve relative paths to errors

VS Code problem matcher are restricted to be static "regexes". You can't create a problem matcher dynamically, and you can't use custom code in lieu of problem matcher.

This creates a problem for rust/cargo compiler errors. They use paths relative to the root of the Cargo workspace, but VS Code doesn't necessary know where that root is.

Luckily, there's a way out: our current problem matcher is defined like this:

    "fileLocation": [ "autoDetect", "${workspaceRoot}" ],

That means that relative pahts would be resoleved relative to workspace root. VS Code allows to specify a command inside `${}`. So we can plug custom logic there to fetch Cargo's workspace root!

And that's exactly what this PR is doing!
…-struct, r=Veykril

Add convert_named_struct_to_tuple_struct assist

Closes rust-lang#11643, since the assist for converting in the other direction is already there (I based most of the implementation and all of the tests on it).
This should be closer to the expected output and gets rid of a few
type mismatches in rustc/library
fix(generate_method): correct method indentation inside generated impl and change gen loc

should fix rust-lang#10619
lnicola and others added 20 commits October 15, 2022 13:02
Bump `actions/setup-node`

Fixes more Node 12 deprecation warnings.
Cast runnableEnv items to string

fix rust-lang#13390

An alternative approach could be raising an error if there is non string values.
Update guide.md to reflect support for proc-macros
Two breaking changes:
- `TypeFolder` has been split into `TypeFolder` and `FallibleTypeFolder`
- `ProjectionTy::self_type_parameter()` has been removed
Bump chalk

There's a bug in current chalk that prevents us from properly supporting GATs, which is supposed to be fixed in v0.86. Note the following:
- v0.86 is only going to be released next Sunday so I'll keep this PR as draft until then.
- This doesn't compile without rust-lang/chalk#779, which I hope will be included in v0.86. I confirmed this compiles with it locally.

Two breaking changes from v0.84:
- `TypeFolder` has been split into `TypeFolder` and `FallibleTypeFolder` (rust-lang/chalk#772)
- `ProjectionTy::self_type_parameter()` has been removed (rust-lang/chalk#778)
feat: Diagnose some incorrect usages of the question mark operator

Trying to figure out how the type stuff in r-a works some more, I think I am doing this correct here but I am not quite sure :)
@lnicola
Copy link
Member Author

lnicola commented Oct 18, 2022

@bors r+ rollup=iffy

libc bumps have failed pretty often on *BSD in the past.

@bors
Copy link
Collaborator

bors commented Oct 18, 2022

📌 Commit cb8fdff has been approved by lnicola

It is now in the queue for this repository.

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Oct 18, 2022
@bors
Copy link
Collaborator

bors commented Oct 18, 2022

⌛ Testing commit cb8fdff with merge e0f8e60...

@bors
Copy link
Collaborator

bors commented Oct 18, 2022

☀️ Test successful - checks-actions
Approved by: lnicola
Pushing e0f8e60 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Oct 18, 2022
@bors bors merged commit e0f8e60 into rust-lang:master Oct 18, 2022
@rustbot rustbot added this to the 1.66.0 milestone Oct 18, 2022
@lnicola lnicola deleted the rust-analyzer-2022-10-18 branch October 18, 2022 10:42
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (e0f8e60): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean1 range count2
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
3.2% [3.0%, 3.3%] 4
Improvements ✅
(primary)
-2.0% [-2.0%, -2.0%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -2.0% [-2.0%, -2.0%] 1

Cycles

This benchmark run did not return any relevant results for this metric.

Footnotes

  1. the arithmetic mean of the percent change

  2. number of relevant changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.