]> git.lizzy.rs Git - rust.git/blob - src/test/ui/try-operator-on-main.stderr
Remove licenses
[rust.git] / src / test / ui / try-operator-on-main.stderr
1 error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `std::ops::Try`)
2   --> $DIR/try-operator-on-main.rs:9:5
3    |
4 LL |     std::fs::File::open("foo")?; //~ ERROR the `?` operator can only
5    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot use the `?` operator in a function that returns `()`
6    |
7    = help: the trait `std::ops::Try` is not implemented for `()`
8    = note: required by `std::ops::Try::from_error`
9
10 error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try`
11   --> $DIR/try-operator-on-main.rs:12:5
12    |
13 LL |     ()?; //~ ERROR the `?` operator can only
14    |     ^^^ the `?` operator cannot be applied to type `()`
15    |
16    = help: the trait `std::ops::Try` is not implemented for `()`
17    = note: required by `std::ops::Try::into_result`
18
19 error[E0277]: the trait bound `(): std::ops::Try` is not satisfied
20   --> $DIR/try-operator-on-main.rs:15:5
21    |
22 LL |     try_trait_generic::<()>(); //~ ERROR the trait bound
23    |     ^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::ops::Try` is not implemented for `()`
24    |
25 note: required by `try_trait_generic`
26   --> $DIR/try-operator-on-main.rs:20:1
27    |
28 LL | fn try_trait_generic<T: Try>() -> T {
29    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
30
31 error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try`
32   --> $DIR/try-operator-on-main.rs:22:5
33    |
34 LL |     ()?; //~ ERROR the `?` operator can only
35    |     ^^^ the `?` operator cannot be applied to type `()`
36    |
37    = help: the trait `std::ops::Try` is not implemented for `()`
38    = note: required by `std::ops::Try::into_result`
39
40 error: aborting due to 4 previous errors
41
42 For more information about this error, try `rustc --explain E0277`.