Skip to content

Conversation

@lnicola
Copy link
Member

@lnicola lnicola commented Nov 24, 2025

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

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

r? @ghost

A4-Tacks and others added 30 commits November 4, 2025 16:42
Supports:

- and <-> and_then
- then_some <-> then

Example
---
```rust
fn foo() {
    let foo = Some("foo");
    return foo.and$0(Some("bar"));
}
```

**Before this PR**

Assist not applicable

**After this PR**

```rust
fn foo() {
    let foo = Some("foo");
    return foo.and_then(|| Some("bar"));
}
```
It cannot be exactly the same, because we have needs rustc doesn't have (namely, accurate enumeration of all methods, not just with a specific name, for completions etc., while rustc also needs a best-effort implementation for diagnostics) but it is closer than the previous impl.

In addition we rewrite the closely related handling of operator inference and impl collection.

This in turn necessitate changing some other parts of inference in order to retain behavior. As a result, the behavior more closely matches rustc and is also more correct.

This fixes 2 type mismatches on self (1 remains) and 4 diagnostics (1 remains), plus some unknown types.
This is required now that we send this clause to the solver.
Example
---
```rust
enum A { $0Foo(u32), Bar$0(i32) }
```

**Before this PR**

```rust
enum A { Foo(u32), Bar(i32) }

impl From<u32> for A {
    fn from(v: u32) -> Self {
        Self::Foo(v)
    }
}
```

**After this PR**

```rust
enum A { Foo(u32), Bar(i32) }

impl From<u32> for A {
    fn from(v: u32) -> Self {
        Self::Foo(v)
    }
}

impl From<i32> for A {
    fn from(v: i32) -> Self {
        Self::Bar(v)
    }
}
```
Example
---
```rust
mod std { pub mod fmt { pub trait Debug {} } }
fn main() {
    $0std::fmt::Debug;
    let x: std::fmt::Debug = std::fmt::Debug;
}
```

**Before this PR**

```rust
use std::fmt;

mod std { pub mod fmt { pub trait Debug {} } }
fn main() {
    fmt::Debug;
    let x: fmt::Debug = fmt::Debug;
}
```

**After this PR**

```rust
use std::fmt::Debug;

mod std { pub mod fmt { pub trait Debug {} } }
fn main() {
    Debug;
    let x: Debug = Debug;
}
```
Like `unsafe(no_mangle)`
Rowan's green nodes are super drop heavy and as lru eviction happens on cancellation this can block for quite some time, especially after cache priming
Example
---
```rust
#[no_mangle]
static lower_case: () = ();
```

**Before this PR**

```text
non_upper_case_globals
```

**After this PR**

No diagnostics
Bumps [js-yaml](https://github.com/nodeca/js-yaml) from 3.14.1 to 3.14.2.
- [Changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md)
- [Commits](nodeca/js-yaml@3.14.1...3.14.2)

---
updated-dependencies:
- dependency-name: js-yaml
  dependency-version: 3.14.2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [glob](https://github.com/isaacs/node-glob) from 11.0.1 to 11.1.0.
- [Changelog](https://github.com/isaacs/node-glob/blob/main/changelog.md)
- [Commits](isaacs/node-glob@v11.0.1...v11.1.0)

---
updated-dependencies:
- dependency-name: glob
  dependency-version: 11.1.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
…incorrect-case

Fix hit incorrect_case on no_mangle static items
fix: make visibility diagnostics for fields to correct location
Example
---
viewHir

```rust
fn main() {
    let r = &2;
    let _ = &mut (*r as i32)
}
```

**Before this PR**

```rust
fn main() {
    let r = &2;
    let _ = &mut *r as i32;
}
```

**After this PR**

```rust
fn main() {
    let r = &2;
    let _ = &mut (*r as i32);
}
```
…yarn/editors/code/glob-11.1.0

Bump glob from 11.0.1 to 11.1.0 in /editors/code
…yarn/editors/code/js-yaml-3.14.2

Bump js-yaml from 3.14.1 to 3.14.2 in /editors/code
Add `unsafe(…)` attribute completion
Veykril and others added 24 commits November 23, 2025 12:31
feat: Completion ` = $0` after keyval cfg predicate
…enum-disc

Add pretty number for add_explicit_enum_discriminant
…vtyr

minor: Use `const_eval_static` query for statics
- Discussed in rust-lang/rust-analyzer#21107
- Avoids activating an `attributes` feature to crates that do not use it
- Updates the 6 crates that use attributes feature to specify it in
  their Cargo.toml: {hir,hir-def,hir-ty,ide-assists,ide-db,project-model}
Auto-loaded via the debugger_visualizer attribute.
Tested on smolstr's unittest:

$ RUSTFLAGS="-C debuginfo=2 -C opt-level=0" cargo test -p smol_str --no-run
$ rust-gdb target/debug/deps/test-a806b111557a7133
(gdb) break test::conversions
(gdb) run
(gdb) next
(gdb) print s
(and other locations in that file, to test the three cases: Inline,
Static and Heap)
…utes-feat

fix: no unused `tracing/attributes` feature
…r_pretty_printer

Provide a gdb pretty printer for smol_str::SmolStr
Major changes:

 - `GoalSource::InstantiateHigherRanked` was removed.
 - `Interner::UnevaluatedConstId` was introduced, allowing further simplifications due to better typing. Generally we don't represent unevaluated consts like we should, but it's still better.
 - `PatternKind::NotNull` was introduced.
add semantic tokens for deprecated items
…targets-outside-pkg-root

fix: include all target types with paths outside package root
…nd-then

Fix not applicable on `and` for replace_method_eager_lazy
Example
---
```rust
fn main() { let _ = &raw $0 }
```

**Before this PR**

```text
fn main() fn()
bt u32     u32
kw const
kw const
kw crate::
...
```

**After this PR**

```text
fn main() fn()
bt u32     u32
kw const
kw crate::
...
```
Fix duplicate `const` complete after `raw`
add deprecated semantic token for extern crate shorthand
proc-macro-srv: Reimplement token trees via immutable trees
@rustbot
Copy link
Collaborator

rustbot commented Nov 24, 2025

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 Nov 24, 2025
@rustbot
Copy link
Collaborator

rustbot commented Nov 24, 2025

⚠️ 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.

@rust-log-analyzer

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.