error[E0308]: mismatched types --> $DIR/unboxing-needing-parenthases-issue-132924.rs:5:29 | LL | let test: Option = x; | ----------- ^ expected `Option`, found `Box>` | | | expected due to this | = note: expected enum `Option` found struct `Box>` help: consider unboxing the value | LL | let test: Option = *x; | + error[E0308]: mismatched types --> $DIR/unboxing-needing-parenthases-issue-132924.rs:8:31 | LL | let test: Option = { x as Box> }; | ^^^^^^^^^^^^^^^^^^^^^ expected `Option`, found `Box>` | = note: expected enum `Option<_>` found struct `Box>` help: consider unboxing the value | LL | let test: Option = { *(x as Box>) }; | ++ + error[E0308]: mismatched types --> $DIR/unboxing-needing-parenthases-issue-132924.rs:12:39 | LL | let test: Option = if true { x as Box> } else { None }; | ^^^^^^^^^^^^^^^^^^^^^ expected `Option`, found `Box>` | = note: expected enum `Option<_>` found struct `Box>` help: consider unboxing the value | LL | let test: Option = if true { *(x as Box>) } else { None }; | ++ + error[E0308]: mismatched types --> $DIR/unboxing-needing-parenthases-issue-132924.rs:16:29 | LL | let test: Option = x as std::rc::Rc>; | ----------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Option`, found `Rc>` | | | expected due to this | = note: expected enum `Option<_>` found struct `Rc>` help: consider dereferencing the type | LL | let test: Option = *(x as std::rc::Rc>); | ++ + error: aborting due to 4 previous errors For more information about this error, try `rustc --explain E0308`.