Closed sunrosa closed 3 days ago
@rustbot claim
I believe I've run into this issue as well. Here's my own reproduction:
fn broken_into_inference(into_string: impl Into<String>) {
let should_be_string = into_string.into();
should_be_string.len();
}
should_be_string
is displayed with a type of {unknown}
and the documentation for stuff like len
won't show up. Using the wrong methods still shows up as an error but I think that's because of a rustc pass or something.
I'm going to assume the root cause is the same, hence why this isn't its own issue. I just want to make sure it gets looked at alongside this reproduction, just in case the root causes are different.
Both of these are cases of #5514.
I am using rust-analyzer VScode extension
v0.3.1940
and rustc1.77.2
. I am having this issue with borrow(). With the impl below:It is resolving to unknown and not linting, but has no compiler errors:
And of course, there is no linting when trying to access fields of the unknown type.