error[E0308]: mismatched types --> $DIR/boxed-variant-field.rs:9:31 | LL | Ty::List(elem) => foo(elem), | ^^^^ expected enum `Ty`, found struct `Box` | = note: expected enum `Ty` found struct `Box` help: try dereferencing the `Box` | LL | Ty::List(elem) => foo(*elem), | + help: try wrapping the expression in `Ty::List` | LL | Ty::List(elem) => foo(Ty::List(elem)), | +++++++++ + error: aborting due to previous error For more information about this error, try `rustc --explain E0308`.