Skip to content

Subtree update of rust-analyzer #132314

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 118 commits into from
Oct 29, 2024
Merged

Subtree update of rust-analyzer #132314

merged 118 commits into from
Oct 29, 2024

Conversation

lnicola
Copy link
Member

@lnicola lnicola commented Oct 29, 2024

r? @ghost

ChayimFriedman2 and others added 30 commits October 20, 2024 19:09
Because our lint infra *can* handle allows from within macro expansions!

(Also, what did this reason have to do with something that is a hard error and not a lint? I'm puzzled).

I wonder how many such diagnostics we have...

Maybe that also mean we can change `unused_mut` to no-longer-experimental? But this is a change I'm afraid to do without checking.
Instead of lowering them to `<expr> = <expr>`, then hacking on-demand to resolve them, we lower them to `<pat> = <expr>`, and use the pattern infrastructure to handle them. It turns out, destructuring assignments are surprisingly similar to pattern bindings, and so only minor modifications are needed.

This fixes few bugs that arose because of the non-uniform handling (for example, MIR lowering not handling slice and record patterns, and closure capture calculation not handling destructuring assignments at all), and furthermore, guarantees we won't have such bugs in the future, since the programmer will always have to explicitly handle `Expr::Assignment`.

Tests don't pass yet; that's because the generated patterns do not exist in the source map. The next commit will fix that.
And few more fixups.

I was worried this will lead to more memory usage since `ExprOrPatId` is double the size of `ExprId`, but this does not regress `analysis-stats .`. If this turns out to be a problem, we can easily use the high bit to encode this information.
…Veykril

Fix status bar message not being marked markdown

Closes rust-lang/rust-analyzer#18323
Also lower them a bit more
feat: render docs from aliased type when type has no docs

Trying to close rust-lang#18344

- [x] ~Find the docs by traversing upwards if the type itself has none but aliasing for another type that might have.~
- [x] Show docs from aliased type.
- [x] Showing description that we are displaying documentation for different definition in hover box.

![image](https://github.com/user-attachments/assets/820d6f97-aa2c-4dc4-8a25-75746e32d950)
…macros, r=lnicola

tests: Add `lsif_contains_generated_constant` test

Closes rust-lang/rust-analyzer#18309
feat: resolve range patterns to their structs

Closes rust-lang#18367
…nxqu

internal: Merge separate inlay hints targeting same range
ChayimFriedman2 and others added 17 commits October 27, 2024 19:23
I.e. the following situation:
```
fn foo() {
    mod bar {
        fn qux() {
            // Prelude path here (e.g. macro use prelude or extern prelude).
        }
    }
}
```
Those were previously unresolved, because, in order to support `self` and `super` properly, since rust-lang#15148 we do not ascend block paths when there is a module in between, but only crate def maps register preludes, not block def maps, and we can't change this because block def map prelude can always be overridden by another block. E.g.
```
fn foo() {
    struct WithTheSameNameAsPreludeItem;
    {
        WithTheSameNameAsPreludeItem
    }
}
```
Here `WithTheSameNameAsPreludeItem` refer to the item from the top block, but if we would register prelude items in each block the child block would overwrite it incorrectly.
internal: Stop producing .gz artifacts for Windows
…e-map

internal: Build source map for `hir_def::TypeRef`s
Report document symbols of kind `variable` for let statements
fix: Properly resolve prelude paths inside modules inside blocks
…xport

fix: Allow public re-export of `extern crate` import
feat: Support `cfg(true)` and `cfg(false)`
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 29, 2024
@rustbot
Copy link
Collaborator

rustbot commented Oct 29, 2024

rust-analyzer is developed in its own repository. If possible, consider making this change to rust-lang/rust-analyzer instead.

cc @rust-lang/rust-analyzer

@lnicola
Copy link
Member Author

lnicola commented Oct 29, 2024

@bors r+ p=1 subtree sync

@bors
Copy link
Collaborator

bors commented Oct 29, 2024

📌 Commit eae9d7a has been approved by lnicola

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 29, 2024
@bors
Copy link
Collaborator

bors commented Oct 29, 2024

⌛ Testing commit eae9d7a with merge c8a8c82...

@bors
Copy link
Collaborator

bors commented Oct 29, 2024

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

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Oct 29, 2024
@bors bors merged commit c8a8c82 into rust-lang:master Oct 29, 2024
7 checks passed
@rustbot rustbot added this to the 1.84.0 milestone Oct 29, 2024
@lnicola lnicola deleted the sync-from-ra branch October 29, 2024 12:31
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (c8a8c82): 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 (secondary 5.1%)

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.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
5.1% [5.1%, 5.1%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Cycles

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

Binary size

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

Bootstrap: 783.928s -> 783.219s (-0.09%)
Artifact size: 333.73 MiB -> 333.74 MiB (0.00%)

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.