Skip to content

Compiler performance returning nested closures #68061

Closed
@197g

Description

@197g

The following takes approximately one year to compile:

fn main() {
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||();
}

(This estimate was derived from observing that compile time scales seemingly exponentially in the depth of the instantiated closure. At level 23 it took about 25 seconds, and at 22 only 13. Extrapolating this doubling-per-depth leads us to about a year at level 43 which is depicted above).

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-borrow-checkerArea: The borrow checkerA-closuresArea: Closures (`|…| { … }`)I-compiletimeIssue: Problems and improvements with respect to compile times.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