Skip to content

rustc overflows its stack when type checking ~~a simple program~~ polymorphmic recursion #38591

Closed
@jhjourdan

Description

@jhjourdan

The following program triggers a stack overflow in rustc:

struct S<T> {
    t : T,
    s : Box<S<fn(u : T)>>
}

fn f(x : S<u32>) { }

fn main () { }

My version of rustc:

$ rustc --version
rustc 1.15.0-nightly (71c06a56a 2016-12-18)

The problem also appears when replacing fn(u : T) with fn() -> T.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-type-systemArea: Type systemC-bugCategory: This is a bug.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions