rust-lang / rust-analyzer

A Rust compiler front-end for IDEs
https://rust-analyzer.github.io/
Apache License 2.0
14.34k stars 1.62k forks source link

The type inference fails when using `Into` #18487

Closed lh123 closed 2 weeks ago

lh123 commented 2 weeks ago

rust-analyzer version: (eg. output of "rust-analyzer: Show RA Version" command, accessible in VSCode via Ctrl/⌘+Shift+P)

rustc version: rustc 1.81.0 (eeb90cda1 2024-09-04)

editor or extension: VSCode

code snippet to reproduce:

// add your code here
fn test<T: Into<String>>(t: T) {
    let v = t.into();
    println!("{v}");
}

Image

lnicola commented 2 weeks ago

Duplicate of #5514