-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve Try error messages #43984
Improve Try error messages #43984
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,10 +2,7 @@ error[E0277]: the trait bound `u32: std::ops::Try` is not satisfied | |
--> $DIR/try-unimplemented.rs:17:5 | ||
| | ||
17 | 3u32? | ||
| ----- | ||
| | | ||
| `?` cannot be applied to a value of type `u32` | ||
| in this macro invocation | ||
| ^^^^^ `?` cannot be applied to a value of type `u32` | ||
| | ||
= help: the trait `std::ops::Try` is not implemented for `u32` | ||
= note: required by `std::ops::Try::into_result` | ||
|
@@ -14,10 +11,7 @@ error[E0277]: the trait bound `(): std::ops::Try` is not satisfied | |
--> $DIR/try-unimplemented.rs:21:5 | ||
| | ||
21 | Ok(3u32)?; | ||
| --------- | ||
| | | ||
| cannot use the `?` operator in a function that returns `()` | ||
| in this macro invocation | ||
| ^^^^^^^^^ cannot use the `?` operator in a function that returns `()` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is this...aspirational? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i.e., I don't see code that would emit this "cannot use" error There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It was intended to test |
||
| | ||
= help: the trait `std::ops::Try` is not implemented for `()` | ||
= note: required by `std::ops::Try::from_error` | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool =)