Skip to content

rustc should not infinite-loop on nested data type #6191

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
pnkfelix opened this issue May 2, 2013 · 1 comment
Closed

rustc should not infinite-loop on nested data type #6191

pnkfelix opened this issue May 2, 2013 · 1 comment

Comments

@pnkfelix
Copy link
Member

pnkfelix commented May 2, 2013

Some languages support "nested data types" (aka non-uniform, aka non-regular). What this basically means are recursive structures S<A> where the recursive references to S within its definition do not take the form S<A>, but instead take the form S<T<A>> for some non-trivial type constructor T.

So, as an example:

enum Seq<A> {
Nil,
Cons{hd: A, tl:~Seq<(A,A)>}
}

impl<A> Seq<A> {
fn len(&self) -> int {
match self {
&Nil => 0,
&Cons{ hd: x, tl: ref s } => 1 + 2 * s.len()
}
}
}

fn main() {
io::println(fmt!("Hello World"));
}

But right now rustc seems to infinite loop on the above. I need to investigate more.

@catamorphism
Copy link
Contributor

Dup of #7587

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants