2022-11-03 09:35:15 -05:00
|
|
|
error[E0425]: cannot find value `err` in this scope
|
|
|
|
--> $DIR/issue-103909.rs:5:12
|
|
|
|
|
|
|
|
|
LL | if Err(err) = File::open("hello.txt") {
|
|
|
|
| ^^^ not found in this scope
|
|
|
|
|
|
|
|
|
help: you might have meant to use pattern matching
|
|
|
|
|
|
|
|
|
LL | if let Err(err) = File::open("hello.txt") {
|
|
|
|
| +++
|
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
|
|
|
--> $DIR/issue-103909.rs:5:8
|
|
|
|
|
|
|
|
|
LL | if Err(err) = File::open("hello.txt") {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found `()`
|
2022-11-08 02:04:14 -06:00
|
|
|
|
|
|
|
|
help: consider adding `let`
|
|
|
|
|
|
|
|
|
LL | if let Err(err) = File::open("hello.txt") {
|
|
|
|
| +++
|
2022-11-03 09:35:15 -05:00
|
|
|
|
|
|
|
error: aborting due to 2 previous errors
|
|
|
|
|
|
|
|
Some errors have detailed explanations: E0308, E0425.
|
|
|
|
For more information about an error, try `rustc --explain E0308`.
|