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

Compiler hangs on recursive HRTB #126519

Closed
Nadrieril opened this issue Jun 15, 2024 · 2 comments
Closed

Compiler hangs on recursive HRTB #126519

Nadrieril opened this issue Jun 15, 2024 · 2 comments
Labels
C-bug Category: This is a bug. I-hang Issue: The compiler never terminates, due to infinite loops, deadlock, livelock, etc.

Comments

@Nadrieril
Copy link
Member

I tried this code:

pub trait LendingIteratorItem<'item> {
    type Item;
}

impl<'item, F> LendingIteratorItem<'item> for (F,)
where
    F: for<'a> FnMut(<Self as LendingIteratorItem<'a>>::Item),
{
    type Item = ();
}

On this code, rustc hangs and slowly eats all my memory. If I change (F,) to F, at least I get "overflow evaluating the requirement" before it eats all my memory. A bunch of other simplifications all error with "overflow evaluating the requirement".

Meta

rustc --version --verbose:

rustc 1.81.0-nightly (f8e566053 2024-06-14)
binary: rustc
commit-hash: f8e566053207b4ecbcbc7a7d6ded82c43061e3da
commit-date: 2024-06-14
host: x86_64-unknown-linux-gnu
release: 1.81.0-nightly
LLVM version: 18.1.7
@Nadrieril Nadrieril added the C-bug Category: This is a bug. label Jun 15, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jun 15, 2024
@matthiaskrgr
Copy link
Member

is this a duplicate / code from #108826 (comment) ?

@Nadrieril
Copy link
Member Author

Ah yep, looks similar

@Nadrieril Nadrieril closed this as not planned Won't fix, can't repro, duplicate, stale Jun 15, 2024
Nadrieril added a commit to Nadrieril/type-walker that referenced this issue Jun 15, 2024
@saethlin saethlin added I-hang Issue: The compiler never terminates, due to infinite loops, deadlock, livelock, etc. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Jun 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. I-hang Issue: The compiler never terminates, due to infinite loops, deadlock, livelock, etc.
Projects
None yet
Development

No branches or pull requests

4 participants