1 error[E0308]: mismatched types
2 --> $DIR/boxed-variant-field.rs:9:31
4 LL | Ty::List(elem) => foo(elem),
5 | --- ^^^^ expected enum `Ty`, found struct `Box`
7 | arguments to this function are incorrect
9 = note: expected enum `Ty`
10 found struct `Box<Ty>`
11 note: function defined here
12 --> $DIR/boxed-variant-field.rs:6:4
14 LL | fn foo(x: Ty) -> Ty {
16 help: consider unboxing the value
18 LL | Ty::List(elem) => foo(*elem),
21 error: aborting due to previous error
23 For more information about this error, try `rustc --explain E0308`.