|
| 1 | +error[E0308]: mismatched types |
| 2 | + --> $DIR/mismatch-ty-unwrap-expect.rs:6:18 |
| 3 | + | |
| 4 | +LL | let v: i32 = Some(1); |
| 5 | + | --- ^^^^^^^ expected `i32`, found `Option<{integer}>` |
| 6 | + | | |
| 7 | + | expected due to this |
| 8 | + | |
| 9 | + = note: expected type `i32` |
| 10 | + found enum `Option<{integer}>` |
| 11 | + |
| 12 | +error[E0308]: mismatched types |
| 13 | + --> $DIR/mismatch-ty-unwrap-expect.rs:7:18 |
| 14 | + | |
| 15 | +LL | let v: i32 = None; |
| 16 | + | --- ^^^^ expected `i32`, found `Option<_>` |
| 17 | + | | |
| 18 | + | expected due to this |
| 19 | + | |
| 20 | + = note: expected type `i32` |
| 21 | + found enum `Option<_>` |
| 22 | + |
| 23 | +error[E0308]: mismatched types |
| 24 | + --> $DIR/mismatch-ty-unwrap-expect.rs:10:18 |
| 25 | + | |
| 26 | +LL | let v: i32 = a; |
| 27 | + | --- ^ expected `i32`, found `Option<{integer}>` |
| 28 | + | | |
| 29 | + | expected due to this |
| 30 | + | |
| 31 | + = note: expected type `i32` |
| 32 | + found enum `Option<{integer}>` |
| 33 | +help: you may missing `unwrap` or `expect(...)` here |
| 34 | + | |
| 35 | +LL | let v: i32 = a.unwrap(); |
| 36 | + | +++++++++ |
| 37 | + |
| 38 | +error[E0308]: mismatched types |
| 39 | + --> $DIR/mismatch-ty-unwrap-expect.rs:13:18 |
| 40 | + | |
| 41 | +LL | let v: i32 = b; |
| 42 | + | --- ^ expected `i32`, found `Result<{integer}, _>` |
| 43 | + | | |
| 44 | + | expected due to this |
| 45 | + | |
| 46 | + = note: expected type `i32` |
| 47 | + found enum `Result<{integer}, _>` |
| 48 | +help: you may missing `unwrap` or `expect(...)` here |
| 49 | + | |
| 50 | +LL | let v: i32 = b.unwrap(); |
| 51 | + | +++++++++ |
| 52 | + |
| 53 | +error[E0308]: mismatched types |
| 54 | + --> $DIR/mismatch-ty-unwrap-expect.rs:16:18 |
| 55 | + | |
| 56 | +LL | let v: i32 = c; |
| 57 | + | --- ^ expected `i32`, found `Result<bool, _>` |
| 58 | + | | |
| 59 | + | expected due to this |
| 60 | + | |
| 61 | + = note: expected type `i32` |
| 62 | + found enum `Result<bool, _>` |
| 63 | + |
| 64 | +error[E0308]: mismatched types |
| 65 | + --> $DIR/mismatch-ty-unwrap-expect.rs:18:18 |
| 66 | + | |
| 67 | +LL | let v: i32 = func(); |
| 68 | + | --- ^^^^^^ expected `i32`, found `Option<i32>` |
| 69 | + | | |
| 70 | + | expected due to this |
| 71 | + | |
| 72 | + = note: expected type `i32` |
| 73 | + found enum `Option<i32>` |
| 74 | +help: you may missing `unwrap` or `expect(...)` here |
| 75 | + | |
| 76 | +LL | let v: i32 = func().unwrap(); |
| 77 | + | +++++++++ |
| 78 | + |
| 79 | +error: aborting due to 6 previous errors |
| 80 | + |
| 81 | +For more information about this error, try `rustc --explain E0308`. |
0 commit comments