Rust analyzer fails to do certain type inference #14953
Replies: 5 comments
-
| Yeah, that shouldn't happen. Can you reproduce this in a clean project with no dependencies other than regex? (I assume  | 
Beta Was this translation helpful? Give feedback.
-
| Yes Regex is from regex crate. It shows the same behaviour with this project that I just created with only regex as dependency. | 
Beta Was this translation helpful? Give feedback.
-
| I can't reproduce that. What Rust version are you using? | 
Beta Was this translation helpful? Give feedback.
-
| Rust version  | 
Beta Was this translation helpful? Give feedback.
-
| Problem got fixed after updating everything to 1.70. Thanks. | 
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I am using rust-analyzer with both vscode and neovim. I have observed sometimes rust-analyzer fails to do type inference (and hence loses further auto-completion) for certain types. For example - the following code
The
Regex::newhas the correct type resolved, but after doing unwrap, the type ofreis unknown as per rust-analyzer. However, the compiler works just fine.Beta Was this translation helpful? Give feedback.
All reactions