Skip to content

hang in fulfill due to exponential blowup #110544

Open
@lcnr

Description

@lcnr
trait Trait {}

struct W<T>(T);

impl<T, U> Trait for W<(W<T>, W<U>)>
where
    W<T>: Trait,
    W<U>: Trait,
{}

fn impls<T: Trait>() {}

fn main() {
    impls::<W<_>>()
}

this program results in a hang in both rustc (fulfill) and in r-a (causing my PC to freeze).

if we prove this using a breadth first approach we try to prove O(2^recursion_limit) goals

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

    Issue actions