Skip to content

Compiler hangs on recursive HRTB #126519

Not planned
Not planned
@Nadrieril

Description

@Nadrieril
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

Activity

added
needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.
on Jun 15, 2024
matthiaskrgr

matthiaskrgr commented on Jun 15, 2024

@matthiaskrgr
Member

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

Nadrieril

Nadrieril commented on Jun 15, 2024

@Nadrieril
MemberAuthor

Ah yep, looks similar

added
I-hangIssue: The compiler never terminates, due to infinite loops, deadlock, livelock, etc.
and removed
needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.
on Jun 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.I-hangIssue: The compiler never terminates, due to infinite loops, deadlock, livelock, etc.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @matthiaskrgr@Nadrieril@saethlin@rustbot

        Issue actions

          Compiler hangs on recursive HRTB · Issue #126519 · rust-lang/rust