error[E0308]: mismatched types --> $DIR/mismatch-ty-unwrap-expect.rs:10:18 | LL | let v: i32 = b; | --- ^ expected `i32`, found `Result` | | | expected due to this | = note: expected type `i32` found enum `Result` help: use the `?` operator to extract the `Result` value, propagating a `Result::Err` value to the caller | LL | let v: i32 = b?; | + error[E0308]: mismatched types --> $DIR/mismatch-ty-unwrap-expect.rs:16:18 | LL | let v: i32 = b; | --- ^ expected `i32`, found `Option<{integer}>` | | | expected due to this | = note: expected type `i32` found enum `Option<{integer}>` help: use the `?` operator to extract the `Option<{integer}>` value, propagating an `Option::None` value to the caller | LL | let v: i32 = b?; | + error[E0308]: mismatched types --> $DIR/mismatch-ty-unwrap-expect.rs:22:18 | LL | let v: i32 = a; | --- ^ expected `i32`, found `Option<{integer}>` | | | expected due to this | = note: expected type `i32` found enum `Option<{integer}>` help: consider using `Option::expect` to unwrap the `Option<{integer}>` value, panicking if the value is an `Option::None` | LL | let v: i32 = a.expect("REASON"); | +++++++++++++++++ error[E0308]: mismatched types --> $DIR/mismatch-ty-unwrap-expect.rs:25:18 | LL | let v: i32 = b; | --- ^ expected `i32`, found `Result` | | | expected due to this | = note: expected type `i32` found enum `Result` help: consider using `Result::expect` to unwrap the `Result` value, panicking if the value is a `Result::Err` | LL | let v: i32 = b.expect("REASON"); | +++++++++++++++++ error[E0308]: mismatched types --> $DIR/mismatch-ty-unwrap-expect.rs:27:18 | LL | let v: i32 = func(); | --- ^^^^^^ expected `i32`, found `Option` | | | expected due to this | = note: expected type `i32` found enum `Option` help: consider using `Option::expect` to unwrap the `Option` value, panicking if the value is an `Option::None` | LL | let v: i32 = func().expect("REASON"); | +++++++++++++++++ error[E0308]: mismatched types --> $DIR/mismatch-ty-unwrap-expect.rs:30:18 | LL | let v: i32 = a; | --- ^ expected `i32`, found `Option<_>` | | | expected due to this | = note: expected type `i32` found enum `Option<_>` help: consider using `Option::expect` to unwrap the `Option<_>` value, panicking if the value is an `Option::None` | LL | let v: i32 = a.expect("REASON"); | +++++++++++++++++ error: aborting due to 6 previous errors For more information about this error, try `rustc --explain E0308`.