Skip to content

rust-analyzer subtree update#155556

Open
lnicola wants to merge 160 commits intorust-lang:mainfrom
lnicola:sync-from-ra
Open

rust-analyzer subtree update#155556
lnicola wants to merge 160 commits intorust-lang:mainfrom
lnicola:sync-from-ra

Conversation

@lnicola
Copy link
Copy Markdown
Member

@lnicola lnicola commented Apr 20, 2026

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

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

r? @ghost

Young-Flash and others added 30 commits April 11, 2026 13:23
Co-authored-by: Amit Singhmar <abhay.singhmar2@gmail.com>
Example
---
```rust
fn foo() {
    let mut arr = [1i32];
    $0arr[0] = 3;$0
    let _ = arr;
}
```

**Before this PR**

```rust
fn foo() {
    let mut arr = [1i32];
    fun_name(&mut arr);
    let _ = arr;
}

fn $0fun_name(arr: &mut [i32; 1]) {
    *arr[0] = 3;
}
```

**After this PR**

```rust
fn foo() {
    let mut arr = [1i32];
    fun_name(&mut arr);
    let _ = arr;
}

fn $0fun_name(arr: &mut [i32; 1]) {
    arr[0] = 3;
}
```
…ent-index

fix: no deref index-expr for extract_function
I chose the order of mut restrictions to be `unsafe mut(...)` for unsafe fields, but it's undecided yet.
feat: Support `impl` and `mut` restrictions
GitHub actions are currently failing with:

    error: unresolved link to `cfg_attr`
       --> crates/ide-completion/src/context.rs:414:61
        |
    414 |     /// Set if we are inside the predicate of a #[cfg] or #[cfg_attr].
        |                                                             ^^^^^^^^ no item named `cfg_attr` in scope
        |
        = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`
        = note: `-D rustdoc::broken-intra-doc-links` implied by `-D warnings`
        = help: to override `-D warnings` add `#[allow(rustdoc::broken_intra_doc_links)]`

     Documenting ide v0.0.0 (/home/runner/work/rust-analyzer/rust-analyzer/crates/ide)
    error: could not document `ide-completion`

Use backticks to fix this.

AI disclosure: written with Claude Opus because it was marginally
faster.
Previously, we didn't recurse in Evaluator::create_memory_map() or
Evaluator::patch_addresses() when handling references with a known
size.

This caused problems for hover rendering on const values, which would
build a memory map for evaluated allocations and then pretty-printed
values by following references through that map.

As a result, references in the map still pointed to the original addresses,
meaning that the value pretty-printer would see the type parameters
before substitution. This could cause stack overflows on well-formed
Rust code using recursive const functions.

Add a regression test for hovering on a recursive const fn that
previously caused stack overflow.

Fixes rust-lang/rust-analyzer#21503

AI disclosure: I used Codex with GPT 5.4 to investigate the issue and
write the initial version of this commit.
We want to complain on PRs that generate rustdoc warnings, but only
deploy the generate HTML on the master branch.

Also fix the existing rustdoc warning.

AI disclosure: Some Claude Opus usage.
internal: Ensure rustdoc GitHub action runs on PRs
Fixes rust-lang/rust-analyzer#21891.

Previously, the completion engine would aggressively bail out if the parent enum was marked . This pushes the visibility check down to the individual variants so they can be properly completed when accessed via a public type alias.
…ocal_inherent_impl_on_render

Demoting completion relevance when an inherent impl already exists
fix: MIR evaluation of sized &T with recursive const fn
fix: complete variants of hidden enums through public aliases
This is a quick fix, please review if there is a regression

Example
---
```rust
fn foo(data: &i32) {}
fn main() {
    let indent = 2i32;
    foo(in$0)
}
```

**Before this PR**

```rust
fn foo(data: &i32) {}
fn main() {
    let indent = 2i32;
    foo(in&dent)
}
```

```rust
source_range: 65..67,
delete: 65..67,
ref_match: "&@67",
..
```

**After this PR**

```rust
fn foo(data: &i32) {}
fn main() {
    let indent = 2i32;
    foo(&indent)
}
```

```rust
source_range: 65..67,
delete: 65..67,
ref_match: "&@65",
..
```
…uickfix

fix: Fix ref_match position when keyword prefix
…tability-api

feat: add is_mutable_raw_ptr and as_raw_ptr to hir::Type
Bumps [rand](https://github.com/rust-random/rand) from 0.9.2 to 0.9.3.
- [Release notes](https://github.com/rust-random/rand/releases)
- [Changelog](https://github.com/rust-random/rand/blob/0.9.3/CHANGELOG.md)
- [Commits](rust-random/rand@rand_core-0.9.2...0.9.3)

---
updated-dependencies:
- dependency-name: rand
  dependency-version: 0.9.3
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
ChayimFriedman2 and others added 22 commits April 20, 2026 03:40
…of the bindings inside

Previously it was the closure, which is incorrect.
This should help speed.

Instead, we do it only when an `Interner` is constructed, since an interner cannot be held across revisions.

There is a problem, though: an interner *can* be held across different databases. To solve that, we also reinit the cache when attaching databases, and take the assumption that everything significant (i.e. that can access the cache) will need to attach the db. This is somewhat risky, but we'll take it for the speed.

Theoretically we could *only* reinit on db attach, but it's less risky this way, and with-crate interner construction is rare.
perf: Do not check solver's cache validity on every access
…-most-make-with-editor-specific-make

Replace make with SyntaxFactory in few handlers
Signed-off-by: Jeremie Drouet <jeremie.drouet@gmail.com>
…ate-lints

fix(21943): remove duplicate lints
This updates the rust-version file to e22c616.
fix: Port call expr type checking and closure upvar inference from rustc
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 20, 2026

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 Apr 20, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 20, 2026

⚠️ 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
Copy link
Copy Markdown
Member Author

lnicola commented Apr 20, 2026

@bors r+ p=1

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors bot commented Apr 20, 2026

📌 Commit 5d84f89 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 Apr 20, 2026
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.