1 error[E0072]: recursive type `MList` has infinite size
2 --> $DIR/infinite-tag-type-recursion.rs:1:1
4 LL | enum MList { Cons(isize, MList), Nil }
5 | ^^^^^^^^^^ ----- recursive without indirection
7 | recursive type has infinite size
9 help: insert some indirection to make `MList` representable
11 LL | enum MList { Cons(isize, Box<MList>), Nil }
13 LL | enum MList { Cons(isize, Rc<MList>), Nil }
15 LL | enum MList { Cons(isize, &MList), Nil }
18 error[E0391]: cycle detected when computing drop-check constraints for `MList`
19 --> $DIR/infinite-tag-type-recursion.rs:1:1
21 LL | enum MList { Cons(isize, MList), Nil }
24 = note: ...which again requires computing drop-check constraints for `MList`, completing the cycle
25 = note: cycle used when computing dropck types for `Canonical { max_universe: U0, variables: [], value: ParamEnvAnd { param_env: ParamEnv { caller_bounds: [], reveal: UserFacing, def_id: None }, value: MList } }`
27 error: aborting due to 2 previous errors
29 Some errors have detailed explanations: E0072, E0391.
30 For more information about an error, try `rustc --explain E0072`.