Dgame
May 16, 2016, 12:03pm
1
This little snippet enables an infinite recursion and after several minutes the compiler crashes with an out of memory error:
enum A {
B(A, A)
}
I believe this should be captured before? Sorry if that is already known, I stumbled about it today and was suprised for a moment.
fbstj
May 16, 2016, 12:08pm
2
after trying in playpen I found this error
error: recursive type `A` has infinite size [--explain E0072]
--> <anon>:1:1
1 |> enum A {
|> ^
help: insert indirection (e.g., a `Box`, `Rc`, or `&`) at some point to make `A` representable
Dgame
May 16, 2016, 12:11pm
3
I'm on Windows with Rust 1.8. I get this (with cargo run):
D:\Rust-Stuff\poly>cargo run
Compiling poly v0.1.0 (file:///D:/Rust-Stuff/poly)
fatal runtime error: out of memory
Could not compile poly
.
To learn more, run the command again with --verbose.
But it took over a minute.