]> git.proxmox.com Git - rustc.git/blame - src/test/ui/suggestions/try-operator-on-main.stderr
New upstream version 1.25.0+dfsg1
[rustc.git] / src / test / ui / suggestions / try-operator-on-main.stderr
CommitLineData
ea8adc8c 1error[E0277]: the `?` operator can only be used in a function that returns `Result` (or another type that implements `std::ops::Try`)
2c00a5a8 2 --> $DIR/try-operator-on-main.rs:19:5
041b39d2 3 |
2c00a5a8
XL
419 | std::fs::File::open("foo")?; //~ ERROR the `?` operator can only
5 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot use the `?` operator in a function that returns `()`
041b39d2
XL
6 |
7 = help: the trait `std::ops::Try` is not implemented for `()`
8 = note: required by `std::ops::Try::from_error`
9
ea8adc8c 10error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try`
2c00a5a8 11 --> $DIR/try-operator-on-main.rs:22:5
ea8adc8c 12 |
2c00a5a8
XL
1322 | ()?; //~ ERROR the `?` operator can only
14 | ^^^ the `?` operator cannot be applied to type `()`
ea8adc8c
XL
15 |
16 = help: the trait `std::ops::Try` is not implemented for `()`
17 = note: required by `std::ops::Try::into_result`
18
19error[E0277]: the trait bound `(): std::ops::Try` is not satisfied
2c00a5a8 20 --> $DIR/try-operator-on-main.rs:25:5
ea8adc8c 21 |
2c00a5a8 2225 | try_trait_generic::<()>(); //~ ERROR the trait bound
ea8adc8c
XL
23 | ^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::ops::Try` is not implemented for `()`
24 |
2c00a5a8
XL
25note: required by `try_trait_generic`
26 --> $DIR/try-operator-on-main.rs:30:1
27 |
2830 | fn try_trait_generic<T: Try>() -> T {
29 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ea8adc8c
XL
30
31error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try`
2c00a5a8 32 --> $DIR/try-operator-on-main.rs:32:5
ea8adc8c 33 |
2c00a5a8
XL
3432 | ()?; //~ ERROR the `?` operator can only
35 | ^^^ the `?` operator cannot be applied to type `()`
ea8adc8c
XL
36 |
37 = help: the trait `std::ops::Try` is not implemented for `()`
38 = note: required by `std::ops::Try::into_result`
39
40error: aborting due to 4 previous errors
041b39d2 41