Skip to content

ICE: Infinite Recursion when compiling recursive type #17483

@arielb1

Description

@arielb1

The following code causes infinite recursion in rustc:

struct Omega<T>(Vec<Omega<Option<T>>>);
fn main () {}

version: rustc 0.12.0-pre (2f9669c74 2014-09-23 12:45:45 +0000), and also today's play.rust-lang.org

The recursion seems to be between various lines of middle::ty::type_contents::tc_ty.

Note that the following code compiles (note Box instead of Vec):

struct Omega<T>(Box<Omega<Option<T>>>);
fn tickle<T>(r: ||->Omega<T>) {}
fn main () {}

but if you add

fn basilisk<T>(r: Option<Omega<T>>) {}

the crash happens again

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions