Skip to content

Inline assist on .into() produces wrong code #21601

@pacak

Description

@pacak
struct Foo {
    x: u32,
}

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

fn make(x: u32) -> Foo {
    x.into()
}

Consider this example. Attempting to use "inline assist" in into() result in this:

fn make(x: u32) -> Foo {
      U::from(x)
  }

While technically correct - it's not helpful. I'd expect to see Foo instead of U.

rust-analyzer version: rust-analyzer 1.93.0 (254b596 2026-01-19)

rustc version: rustc 1.93.0 (254b59607 2026-01-19)

editor or extension: neovim, rustaceanvim

relevant settings: Nothing really

repository link (if public, optional): (eg. rust-analyzer)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions