]> git.lizzy.rs Git - rust.git/blobdiff - src/test/ui/infinite/infinite-tag-type-recursion.stderr
On recursive ADT, provide indirection structured suggestion
[rust.git] / src / test / ui / infinite / infinite-tag-type-recursion.stderr
index 11f82b842ba6f600caba727f333441fbe102d653..b6a4d8f4cf563bb0983897f3016c6acad1539b32 100644 (file)
@@ -6,7 +6,14 @@ LL | enum MList { Cons(isize, MList), Nil }
    | |
    | recursive type has infinite size
    |
-   = help: insert indirection (e.g., a `Box`, `Rc`, or `&`) at some point to make `MList` representable
+help: insert some indirection to make `MList` representable
+   |
+LL | enum MList { Cons(isize, Box<MList>), Nil }
+   |                          ^^^^     ^
+LL | enum MList { Cons(isize, Rc<MList>), Nil }
+   |                          ^^^     ^
+LL | enum MList { Cons(isize, &MList), Nil }
+   |                          ^
 
 error[E0391]: cycle detected when computing drop-check constraints for `MList`
   --> $DIR/infinite-tag-type-recursion.rs:1:1