-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
C-bugCategory: bugCategory: bug
Description
rust-analyzer version: 0.3.2500-standalone
rustc version: 1.86.0 (05f9846f8 2025-03-31)
editor or extension: Vscode 0.3.2500
relevant settings: nothing relevant I think
code snippet to reproduce:
pub fn gets_apit(s: impl Into<String>) {
let a = s.into();
takes_str(&a);
takes_string(a);
}
fn takes_str(_: &str) {}
fn takes_string(_: String) {}
Seems like r-a ignores the APIT constraints and tries to infer it from the first usage leading it to think its a string.
This also reproduces on the pre-release vscode version. I vaguely remember this kind of inference in inlay hints being wrong at times but now it emits an error diagnostic although of course this works.
Metadata
Metadata
Assignees
Labels
C-bugCategory: bugCategory: bug