#Rust Analyzer giving `{unknown}` types to known functions

5 messages · Page 1 of 1 (latest)

median fog
#

Did you ever find a solution for this? I'm encountering this trying to call .split() on an str, which is surprising to say the least

olive lion
#

The weirdness is explained by the fact RA's type checker is actually not the same as rustc's type checker, and they don't always agree in all cases

#

I don't know what would be a fix for this

ruby mountain
#

(Sorry for the confusing title. It's hard to name this specific problem I'm having)

Lately I've been having problems with Rust Anaylzer . Sometimes, some functions are not autocompleted nor it knows it is a function. It just gives the {unknown} type.

What is weird about this is:

  1. The function that I'm trying works and is documented in the official Rust documentation.
  2. Errors are supported for the function with the {unknown} type (i.e., if the function has some argument and I don't give it any, it will pop up an error).

Example: In this case, the variable changes is a simple Vec of a defined struct.

#

Rust Analyzer giving {unknown} types to known functions