Skip to content
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

100% CPU and slowly eating up the memory when analyzing self-referential closure type example #8740

Open
steffahn opened this issue May 6, 2021 · 1 comment
Labels
A-perf performance issues A-ty type system / type inference / traits / method resolution S-actionable Someone could pick this issue up and work on it right now

Comments

@steffahn
Copy link
Member

steffahn commented May 6, 2021

I ran across rust-lang/rust#46062 today and wanted to play around with the example provided there

fn fix<F>(f: F) -> impl Fn()
where F: Fn(&F)
{
    move || f(&f)
}

fn main() {
    let x = fix(|x| {
        // in here, the closure has a shared reference to itself, `x`
    });
    x();
}

(which is not compiling and also not supposed to compile with current rustc) but rust-analyzer doesn’t like it at all and runs at full CPU (of course only on a single core), never terminating, while slowly increasing its memory usage further and further.

@Veykril
Copy link
Member

Veykril commented May 6, 2021

Sounds like this might be a problem with chalk again?

@Veykril Veykril added A-ty type system / type inference / traits / method resolution S-actionable Someone could pick this issue up and work on it right now labels May 6, 2021
@lnicola lnicola added the A-perf performance issues label Sep 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-perf performance issues A-ty type system / type inference / traits / method resolution S-actionable Someone could pick this issue up and work on it right now
Projects
None yet
Development

No branches or pull requests

3 participants