Skip to content

stack overflow with "recursive" trait bound on an associated type #20551

Closed
@sellibitze

Description

@sellibitze

I just tried this (last time was 2015-01-08) on playpen:

trait Trait {
    type AssocType: Trait;
}
fn main() {}

which apparently makes rustc do an infinite recursion (or something) ending in a stack overflow:

thread 'rustc' has overflowed its stack
Illegal instruction (core dumped)
playpen: application terminated with error code 132

If I remove the : Trait in the line for the associated type, it works again.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-associated-itemsArea: Associated items (types, constants & functions)I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions