]> git.lizzy.rs Git - rust.git/blobdiff - src/test/ui/span/E0072.stderr
On recursive ADT, provide indirection structured suggestion
[rust.git] / src / test / ui / span / E0072.stderr
index d4a5e7400d2a46b7b9cd89d29ff82ccb8448fd59..855e4facb7b8cb93127561dc2675ac5bb893344a 100644 (file)
@@ -5,9 +5,16 @@ LL | struct ListNode {
    | ^^^^^^^^^^^^^^^ recursive type has infinite size
 LL |     head: u8,
 LL |     tail: Option<ListNode>,
-   |     ---------------------- recursive without indirection
+   |           ---------------- recursive without indirection
    |
-   = help: insert indirection (e.g., a `Box`, `Rc`, or `&`) at some point to make `ListNode` representable
+help: insert some indirection to make `ListNode` representable
+   |
+LL |     tail: Box<Option<ListNode>>,
+   |           ^^^^                ^
+LL |     tail: Rc<Option<ListNode>>,
+   |           ^^^                ^
+LL |     tail: &Option<ListNode>,
+   |           ^
 
 error: aborting due to previous error