Open
Description
I get a pretty strange error when trying to compile this: (playground link)
enum Stuff<T> {
Value(T),
Nested(Box<Stuff<Stuff<T>>>),
}
fn main() {
let a = Stuff::Value(1);
}
output:
error[E0320]: overflow while adding drop-check rules for Stuff<i32>
--> src/main.rs:7:9
|
7 | let a = Stuff::Value(1);
| ^
|
= note: overflowed on Stuff<Stuff<Stuff<Stuff<Stuff<Stuff< ...
If the type isn't used, the program compiles fine. Don't know if the type is actually representable or not, the error is misleading.