-
Notifications
You must be signed in to change notification settings - Fork 13.3k
E277 could have a more helpful error message when it occurs on a try expression #59980
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
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-trait-system
Area: Trait system
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
Comments
Centril
added a commit
to Centril/rust
that referenced
this issue
Apr 18, 2019
Point at try `?` on errors affecting the err match arm of the desugared code Fix rust-lang#59980.
Centril
added a commit
to Centril/rust
that referenced
this issue
Apr 18, 2019
Point at try `?` on errors affecting the err match arm of the desugared code Fix rust-lang#59980.
Centril
added a commit
to Centril/rust
that referenced
this issue
Apr 18, 2019
Point at try `?` on errors affecting the err match arm of the desugared code Fix rust-lang#59980.
Centril
added a commit
to Centril/rust
that referenced
this issue
Apr 18, 2019
Point at try `?` on errors affecting the err match arm of the desugared code Fix rust-lang#59980.
Centril
added a commit
to Centril/rust
that referenced
this issue
Apr 19, 2019
Point at try `?` on errors affecting the err match arm of the desugared code Fix rust-lang#59980.
Centril
added a commit
to Centril/rust
that referenced
this issue
Apr 19, 2019
Point at try `?` on errors affecting the err match arm of the desugared code Fix rust-lang#59980.
Centril
added a commit
to Centril/rust
that referenced
this issue
Apr 19, 2019
Point at try `?` on errors affecting the err match arm of the desugared code Fix rust-lang#59980.
Centril
added a commit
to Centril/rust
that referenced
this issue
Apr 19, 2019
Point at try `?` on errors affecting the err match arm of the desugared code Fix rust-lang#59980.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-trait-system
Area: Trait system
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
Currently E277's message is confusing and seemingly ambiguous when it occurs on a try (
?
) expression (this may not be limited to E277, it's just the one I noticed). For example, in this code:The problem is that
the_inner_method
's error type isbool
whilethe_outer_method
's error type is()
. In this case the error isn't too confusing, but if the try is in a chained expression (foo()?.bar()
) and you're a noob it isn't clear why it wantsstd::convert::From<bool>
implemented on()
.It doesn't necessarily even require a whole fix suggestion, all it would take is making the error only highlight the
?
, as the issue is actually occuring when unwrapping the result.Thanks!
The text was updated successfully, but these errors were encountered: