blob: beb627bda6bd1225f610e2dfa8cb6fd49095c202 [file] [log] [blame]
error[E0277]: the `?` operator can only be used in a function that returns `Result` (or another type that implements `std::ops::Try`)
--> $DIR/try-operator-on-main.rs:19:5
|
19 | std::fs::File::open("foo")?; //~ ERROR the `?` operator can only
| ---------------------------
| |
| cannot use the `?` operator in a function that returns `()`
| in this macro invocation
|
= help: the trait `std::ops::Try` is not implemented for `()`
= note: required by `std::ops::Try::from_error`
error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try`
--> $DIR/try-operator-on-main.rs:22:5
|
22 | ()?; //~ ERROR the `?` operator can only
| ---
| |
| the `?` operator cannot be applied to type `()`
| in this macro invocation
|
= help: the trait `std::ops::Try` is not implemented for `()`
= note: required by `std::ops::Try::into_result`
error[E0277]: the trait bound `(): std::ops::Try` is not satisfied
--> $DIR/try-operator-on-main.rs:25:5
|
25 | try_trait_generic::<()>(); //~ ERROR the trait bound
| ^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::ops::Try` is not implemented for `()`
|
= note: required by `try_trait_generic`
error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try`
--> $DIR/try-operator-on-main.rs:32:5
|
32 | ()?; //~ ERROR the `?` operator can only
| ---
| |
| the `?` operator cannot be applied to type `()`
| in this macro invocation
|
= help: the trait `std::ops::Try` is not implemented for `()`
= note: required by `std::ops::Try::into_result`
error: aborting due to 4 previous errors