New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
For loop over hashmap breaks rust-analyzer #1744
Comments
Hm. It sounds like it could be another Chalk loop, but I can't reproduce this with just this code in a fresh project. Do type hints or hover show the correct types for the loop variables? Can you run |
That's strange, but now I can't reproduce it in the simple example as well. I guess there were some other side-effects, though I kept restarting RA to make sure everything was "clean". If you're curious to take a look for yourself, I've made a somewhat "minimal" example in https://github.com/ElusiveMori/ceres-wc3/tree/rustanalyzer-bug , the culprit is in Answering your questions:
Curiously enough, if I rewrite the loop like this: for (id, compiled_module) in self.compiled_modules.iter() {
} then the issue goes away. |
Yeah, it's very likely to be the same (kind of) problem as #1684, then. |
@flodiebold I think I found a reproducible example, if you need one: use atoi::atoi;
pub fn evil(sauron: &[u8]) -> u32 {
atoi(&sauron).unwrap()
} I couldn't remove the Manually specifying the generic parameter like Tested using |
It's an interesting example, thanks! |
This was fixed by #1800. |
I've run into a very strange issue with a single file in my project and a single loop (!) causing 100% CPU usage on
ra_lsp_server
and a memory leak of around 10 MB/s.I've been able to narrow it down to a very strange, but simple pattern of code:
This simple piece of code has been responsible for at least 3 OOM-related crashes on my system so far :(
I'm using rust-analyzer built on the latest master, and running on Linux. Here's hoping this bug report is helpful.
The text was updated successfully, but these errors were encountered: