Skip to content

rust-analyzer subtree update#159210

Merged
rust-bors[bot] merged 92 commits into
rust-lang:mainfrom
lnicola:sync-from-ra
Jul 13, 2026
Merged

rust-analyzer subtree update#159210
rust-bors[bot] merged 92 commits into
rust-lang:mainfrom
lnicola:sync-from-ra

Conversation

@lnicola

@lnicola lnicola commented Jul 13, 2026

Copy link
Copy Markdown
Member

Subtree update of rust-analyzer to rust-lang/rust-analyzer@ffcdbbd.

Created using https://github.com/rust-lang/josh-sync.

r? @ghost

MavenRain and others added 30 commits June 6, 2026 22:19
ExprValidator::check_unused_must_use previously matched only Expr::Call and Expr::MethodCall directly on the expression of a Statement::Expr with semicolon. This left several stmt-with-semi cases unwarned: blocks whose tail is a #[must_use] call, unsafe-blocks, if/else arms, match arms, and const blocks.

Refactors check_unused_must_use to walk into Expr::Block { tail }, Expr::Unsafe { tail }, Expr::If { then_branch, else_branch }, Expr::Match { arms }, and Expr::Const(inner) before applying the existing leaf check (callee or method #[must_use] attribute, or #[must_use] ADT return type). The diagnostic stays at the leaf call so the span points to the actual must_use producer rather than the wrapping block.

Adds ide-diagnostics tests covering each new container case.

Follow-up to rust-lang/rust-analyzer#22239.

Signed-off-by: Onyeka Obi <softwareengineerasaservant@isurvivable.cv>
The `resolver.lockfile_path` setting was stabilized, so we can omit the `-Zlockfile-path` argument.
- clean-up `MacroArgResult` docs
- remove needless import
- move `impl_internable!(ModPath)` to `mod_path.rs`
- combine the impl blocks of HirFileId
  AFAICT there's no semantic separation between them, and the first impl
  block is placed before the definition itself.
Add a simple info log statement when cache priming finishes on startup.

Disclosure: Anthropic Claude 3.5 Flash assisted with this change.
NavigationTarget::docs isn't actually used anywhere, so remove it.

After 05c0f88c77233154ca592d59c90ec7da81ad63da I thought I'd take a
look at any other obviously unused fields and found this. This change
has negligible performance impact in my testing, but it's less code.

AI disclosure: Written with help by Claude and Fable 5.
…e-to-ready

provide startup time to ready log point and associated benchmark
…_id-and-hir_file_id-methods

internal: remove some more `ExpandDatabase` queries
- move span map creation out of the closure, as it's an expensive operation
internal: migrate `ExpandDatabase::*span_map` queries
We should strip `///` (or `//!` or `/**` or `/*!`), which is 3 characters, not 2.
 - Increase the recursion depth when handling the expansion and not when expanding, so that we actually respect the recursion limit.
 - Reuse the already-available span map on expansion.
 - Have only one context struct.
Example
---
```diff
-typeT = $0 whereSelf:Sized;
+type T = $0 where Self: Sized;
```
- Use `HirFileId::parse_with_map`. This avoids a duplicate call to
  `MacroCallId::parse_macro_expansion` in the macro case.
For symmetry with `MacroCallId::macro_expand`
internal: make `expand_speculative` a method on `MacroCallId`
Instead of constructing both kinds of expanders in the same macro call,
construct them in two. This allows for some deduplication in the macro
definition.

AFAICT having everything in the same macro was necessary in order to
implement `find_by_name`, but I've changed it to be a method on each of
the expanders, with `find_builtin_macro` calling both and combining
their results.

Also the macro now accepts an optional trailing comma.

All of this makes the macro more similar to the ones in `attr_macro` and
`derive_macro`.
j-ricardo-goncalves and others added 11 commits July 11, 2026 20:25
by reusing the function escape_snippet_bits used in postfix.rs, the issue seems to be gone completely.
made one test cases, using $bar as per the issue rust-lang#22596 by kpreid.
tried making a $0 test case but although it was working on the IDE, the test case always failed.
a possible improvement would be moving escape_snippet_bits to place where both postfix.rs and on_enter.rs can see it,
but im not sure where I would do that...
fix: clamp cttz const-eval result to type width
Example
---
```rust
const VALS: [i32; 2$0] = [1, 2, 3];
```

**Before this PR**

No available fixes

**After this PR**

```rust
const VALS: [i32; 3] = [1, 2, 3];
```
feat: add fixes for array length for type_mismatch
After we removed `DefDatabase`, it is now always `SourceDatabase`.
internal: Remove the `Database` assoc type from the `Intern` & `Lookup` traits
@rustbot

rustbot commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

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

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-rust-analyzer Relevant to the rust-analyzer team, which will review and decide on the PR/issue. labels Jul 13, 2026
@rustbot

rustbot commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

⚠️ Warning ⚠️

  • There are issue links (such as #123) in the commit messages of the following commits.
    Please move them to the PR description, to avoid spamming the issues with references to the commit, and so this bot can automatically canonicalize them to avoid issues with subtree.

@lnicola

lnicola commented Jul 13, 2026

Copy link
Copy Markdown
Member Author

@bors r+ p=1

@rust-bors

rust-bors Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 63344e6 has been approved by lnicola

It is now in the queue for this repository.

@rust-bors rust-bors Bot 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 Jul 13, 2026
rust-bors Bot pushed a commit that referenced this pull request Jul 13, 2026
Rollup of 11 pull requests

Successful merges:

 - #159210 (`rust-analyzer` subtree update)
 - #158655 (Fix coroutine MIR saved local remapping)
 - #159205 (bootstrap: Replace `ShouldRun::crates` with `crate_or_deps_filtered`)
 - #159208 (Fix `attr_on_non_tail_expr` typo)
 - #157524 (Fix relative paths in private import suggestions)
 - #158325 (Document NonNull layout guarantees)
 - #158882 (enable `do_not_recommend` attr for method call errors in current solver)
 - #158982 (Pretty-print MIR user types too.)
 - #159069 (Add codegen test for constant returns after local use)
 - #159163 (rustc_target: Add acquire-release to implied features of v8)
 - #159201 (borrowck: Represent 'best blame constraint' as index into `Vec<OutlivesConstraint>`)
@rust-bors

rust-bors Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

⌛ Testing commit 63344e6 with merge bdce362...

Workflow: https://github.com/rust-lang/rust/actions/runs/29246732134

rust-bors Bot pushed a commit that referenced this pull request Jul 13, 2026
`rust-analyzer` subtree update

Subtree update of `rust-analyzer` to rust-lang/rust-analyzer@ffcdbbd.

Created using https://github.com/rust-lang/josh-sync.

r? @ghost
@JonathanBrouwer

Copy link
Copy Markdown
Contributor

@bors yield
Yielding to enclosing rollup

@rust-bors

rust-bors Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Auto build was cancelled. Cancelled workflows:

The next pull request likely to be tested is #159213.

rust-bors Bot pushed a commit that referenced this pull request Jul 13, 2026
Rollup of 11 pull requests

Successful merges:

 - #159210 (`rust-analyzer` subtree update)
 - #158655 (Fix coroutine MIR saved local remapping)
 - #159205 (bootstrap: Replace `ShouldRun::crates` with `crate_or_deps_filtered`)
 - #159208 (Fix `attr_on_non_tail_expr` typo)
 - #157524 (Fix relative paths in private import suggestions)
 - #158325 (Document NonNull layout guarantees)
 - #158882 (enable `do_not_recommend` attr for method call errors in current solver)
 - #158982 (Pretty-print MIR user types too.)
 - #159069 (Add codegen test for constant returns after local use)
 - #159163 (rustc_target: Add acquire-release to implied features of v8)
 - #159201 (borrowck: Represent 'best blame constraint' as index into `Vec<OutlivesConstraint>`)
@rust-bors rust-bors Bot merged commit 7e51cb2 into rust-lang:main Jul 13, 2026
13 of 14 checks passed
@rustbot rustbot added this to the 1.99.0 milestone Jul 13, 2026
rust-timer added a commit that referenced this pull request Jul 13, 2026
Rollup merge of #159210 - lnicola:sync-from-ra, r=lnicola

`rust-analyzer` subtree update

Subtree update of `rust-analyzer` to rust-lang/rust-analyzer@ffcdbbd.

Created using https://github.com/rust-lang/josh-sync.

r? @ghost
@lnicola lnicola deleted the sync-from-ra branch July 13, 2026 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-rust-analyzer Relevant to the rust-analyzer team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.