-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Provide better compiler output when using ?
on Option
in fn returning Result
or vice-versa?
#71089
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
D-papercut
Diagnostics: An error or lint that needs small tweaks.
F-on_unimplemented
Error messages that can be tackled with `#[rustc_on_unimplemented]`
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Comments
jonas-schievink
added
A-diagnostics
Area: Messages for errors, warnings, and lints
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
labels
Apr 13, 2020
estebank
added
the
F-on_unimplemented
Error messages that can be tackled with `#[rustc_on_unimplemented]`
label
Apr 14, 2020
This error is emitted here: rust/src/librustc_trait_selection/traits/error_reporting/mod.rs Lines 278 to 313 in 8e18e26
We could look at whether the |
estebank
added
the
D-papercut
Diagnostics: An error or lint that needs small tweaks.
label
Apr 14, 2020
Can I claim this issue? |
@rustbot claim |
Dylan-DPC-zz
pushed a commit
to Dylan-DPC-zz/rust
that referenced
this issue
Apr 15, 2020
Provide better compiler output when using `?` on `Option` in fn returning `Result` and vice-versa Fixes rust-lang#71089
Dylan-DPC-zz
pushed a commit
to Dylan-DPC-zz/rust
that referenced
this issue
Apr 15, 2020
Provide better compiler output when using `?` on `Option` in fn returning `Result` and vice-versa Fixes rust-lang#71089
Dylan-DPC-zz
pushed a commit
to Dylan-DPC-zz/rust
that referenced
this issue
Apr 16, 2020
Provide better compiler output when using `?` on `Option` in fn returning `Result` and vice-versa Fixes rust-lang#71089
Dylan-DPC-zz
pushed a commit
to Dylan-DPC-zz/rust
that referenced
this issue
Apr 16, 2020
Provide better compiler output when using `?` on `Option` in fn returning `Result` and vice-versa Fixes rust-lang#71089
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
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
D-papercut
Diagnostics: An error or lint that needs small tweaks.
F-on_unimplemented
Error messages that can be tackled with `#[rustc_on_unimplemented]`
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
It seems that
rustc
should provide a better error message or hint when one tries to use the?
operator on anOption
in a function returning aResult
or vice-versa.Currently this is the error you get:
However, it would be better to suggest the use of
Option::ok_or
orOption::ok_or_else
, orResult::ok
, instead of referencing something dependent on thetry_trait
feature (NoneError
).This issue has been assigned to @Duddino via this comment.
The text was updated successfully, but these errors were encountered: