]> git.lizzy.rs Git - rust.git/blobdiff - src/test/ui/issues/issue-3008-3.stderr
On recursive ADT, provide indirection structured suggestion
[rust.git] / src / test / ui / issues / issue-3008-3.stderr
index 22c0871fb0ca32cbfd3a132334f865308e13b63f..e6efad918830005cc1a9aadfefc78bfdf2114fab 100644 (file)
@@ -1,12 +1,19 @@
 error[E0072]: recursive type `E2` has infinite size
-  --> $DIR/issue-3008-3.rs:14:1
+  --> $DIR/issue-3008-3.rs:4:1
    |
 LL | enum E2<T> { V2(E2<E1>, marker::PhantomData<T>), }
    | ^^^^^^^^^^      ------ recursive without indirection
    | |
    | recursive type has infinite size
    |
-   = help: insert indirection (e.g., a `Box`, `Rc`, or `&`) at some point to make `E2` representable
+help: insert some indirection to make `E2` representable
+   |
+LL | enum E2<T> { V2(Box<E2<E1>>, marker::PhantomData<T>), }
+   |                 ^^^^      ^
+LL | enum E2<T> { V2(Rc<E2<E1>>, marker::PhantomData<T>), }
+   |                 ^^^      ^
+LL | enum E2<T> { V2(&E2<E1>, marker::PhantomData<T>), }
+   |                 ^
 
 error: aborting due to previous error