|
| 1 | +error[E0308]: mismatched types |
| 2 | + --> $DIR/unboxing-needing-parenthases-issue-132924.rs:5:29 |
| 3 | + | |
| 4 | +LL | let test: Option<i32> = x; |
| 5 | + | ----------- ^ expected `Option<i32>`, found `Box<Option<{integer}>>` |
| 6 | + | | |
| 7 | + | expected due to this |
| 8 | + | |
| 9 | + = note: expected enum `Option<i32>` |
| 10 | + found struct `Box<Option<{integer}>>` |
| 11 | +help: consider unboxing the value |
| 12 | + | |
| 13 | +LL | let test: Option<i32> = *x; |
| 14 | + | + |
| 15 | + |
| 16 | +error[E0308]: mismatched types |
| 17 | + --> $DIR/unboxing-needing-parenthases-issue-132924.rs:8:31 |
| 18 | + | |
| 19 | +LL | let test: Option<i32> = { x as Box<Option<i32>> }; |
| 20 | + | ^^^^^^^^^^^^^^^^^^^^^ expected `Option<i32>`, found `Box<Option<i32>>` |
| 21 | + | |
| 22 | + = note: expected enum `Option<_>` |
| 23 | + found struct `Box<Option<_>>` |
| 24 | +help: consider unboxing the value |
| 25 | + | |
| 26 | +LL | let test: Option<i32> = { *(x as Box<Option<i32>>) }; |
| 27 | + | ++ + |
| 28 | + |
| 29 | +error[E0308]: mismatched types |
| 30 | + --> $DIR/unboxing-needing-parenthases-issue-132924.rs:12:39 |
| 31 | + | |
| 32 | +LL | let test: Option<i32> = if true { x as Box<Option<i32>> } else { None }; |
| 33 | + | ^^^^^^^^^^^^^^^^^^^^^ expected `Option<i32>`, found `Box<Option<i32>>` |
| 34 | + | |
| 35 | + = note: expected enum `Option<_>` |
| 36 | + found struct `Box<Option<_>>` |
| 37 | +help: consider unboxing the value |
| 38 | + | |
| 39 | +LL | let test: Option<i32> = if true { *(x as Box<Option<i32>>) } else { None }; |
| 40 | + | ++ + |
| 41 | + |
| 42 | +error[E0308]: mismatched types |
| 43 | + --> $DIR/unboxing-needing-parenthases-issue-132924.rs:16:29 |
| 44 | + | |
| 45 | +LL | let test: Option<i32> = x as std::rc::Rc<Option<i32>>; |
| 46 | + | ----------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Option<i32>`, found `Rc<Option<i32>>` |
| 47 | + | | |
| 48 | + | expected due to this |
| 49 | + | |
| 50 | + = note: expected enum `Option<_>` |
| 51 | + found struct `Rc<Option<_>>` |
| 52 | +help: consider dereferencing the type |
| 53 | + | |
| 54 | +LL | let test: Option<i32> = *(x as std::rc::Rc<Option<i32>>); |
| 55 | + | ++ + |
| 56 | + |
| 57 | +error: aborting due to 4 previous errors |
| 58 | + |
| 59 | +For more information about this error, try `rustc --explain E0308`. |
0 commit comments