blob: e9b23daec0375b9017b17a6878abdf123e245554 [file] [log] [blame] [edit]
error[E0308]: mismatched types
--> $DIR/try-block-as-statement.rs:19:19
|
LL | let foo = std::fs::read_to_string(a)?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found `Result<_, Error>`
|
= note: expected unit type `()`
found enum `Result<_, std::io::Error>`
help: consider using `Result::expect` to unwrap the `Result<_, std::io::Error>` value, panicking if the value is a `Result::Err`
|
LL | let foo = std::fs::read_to_string(a)?.expect("REASON");
| +++++++++++++++++
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0308`.