Skip to content

Compiler hangs during recursive monomorphisation #39684

Closed
@matklad

Description

@matklad
use std::iter;

fn silly<I: Iterator<Item=()>>(it: I) {
    silly(it.chain(iter::empty()))
}

fn main() {
    println!("Start");
    silly(iter::empty());
    println!("Done");
}

This code causes compiler to be stuck wasting CPU cycles, instead of printing some kind of recursion limit error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.I-compiletimeIssue: Problems and improvements with respect to compile times.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions