diff options
| author | Ariel Ben-Yehuda <ariel.byd@gmail.com> | 2017-08-31 22:52:49 +0300 |
|---|---|---|
| committer | Ariel Ben-Yehuda <ariel.byd@gmail.com> | 2017-09-03 13:10:54 +0300 |
| commit | 291b4eddcefd1d6da1010f8a1f02f05338a44050 (patch) | |
| tree | ba9a44f1e16425d7984a1e32bade04a6f23c3323 /src/test/ui/suggestions | |
| parent | efa09ea554575cd0b4ce01ada44fce730c0f7ac4 (diff) | |
| download | rust-291b4eddcefd1d6da1010f8a1f02f05338a44050.tar.gz rust-291b4eddcefd1d6da1010f8a1f02f05338a44050.zip | |
add error message for the other case too
Diffstat (limited to 'src/test/ui/suggestions')
| -rw-r--r-- | src/test/ui/suggestions/try-operator-on-main.rs | 2 | ||||
| -rw-r--r-- | src/test/ui/suggestions/try-operator-on-main.stderr | 10 |
2 files changed, 7 insertions, 5 deletions
diff --git a/src/test/ui/suggestions/try-operator-on-main.rs b/src/test/ui/suggestions/try-operator-on-main.rs index 473efea54de..eadd12924df 100644 --- a/src/test/ui/suggestions/try-operator-on-main.rs +++ b/src/test/ui/suggestions/try-operator-on-main.rs @@ -16,7 +16,7 @@ fn main() { // error for a `Try` type on a non-`Try` fn std::fs::File::open("foo")?; - // a non-`Try` type on a `Try` fn + // a non-`Try` type on a non-`Try` fn ()?; // an unrelated use of `Try` diff --git a/src/test/ui/suggestions/try-operator-on-main.stderr b/src/test/ui/suggestions/try-operator-on-main.stderr index 5fc24e46fa7..e83bf2abc15 100644 --- a/src/test/ui/suggestions/try-operator-on-main.stderr +++ b/src/test/ui/suggestions/try-operator-on-main.stderr @@ -10,15 +10,16 @@ error[E0277]: the `?` operator can only be used in a function that returns `Resu = help: the trait `std::ops::Try` is not implemented for `()` = note: required by `std::ops::Try::from_error` -error[E0277]: the trait bound `(): std::ops::Try` is not satisfied +error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try` --> $DIR/try-operator-on-main.rs:20:5 | 20 | ()?; | --- | | - | the trait `std::ops::Try` is not implemented for `()` + | 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 @@ -29,15 +30,16 @@ error[E0277]: the trait bound `(): std::ops::Try` is not satisfied | = note: required by `try_trait_generic` -error[E0277]: the trait bound `(): std::ops::Try` is not satisfied +error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try` --> $DIR/try-operator-on-main.rs:30:5 | 30 | ()?; | --- | | - | the trait `std::ops::Try` is not implemented for `()` + | 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 |
