Skip to content
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

Error messages for ? are not great #37671

Closed
brson opened this issue Nov 9, 2016 · 2 comments
Closed

Error messages for ? are not great #37671

brson opened this issue Nov 9, 2016 · 2 comments
Labels
A-diagnostics Area: Messages for errors, warnings, and lints C-enhancement Category: An issue proposing an enhancement or a PR with one. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@brson
Copy link
Contributor

brson commented Nov 9, 2016

fn main() {
    Ok("lol")?;
}
$ rustc test.rs
error[E0277]: the trait bound `(): std::ops::Carrier` is not satisfied
 --> test.rs:2:5
  |
2 |     Ok("lol")?;
  |     ^^^^^^^^^^ the trait `std::ops::Carrier` is not implemented for `()`
  |
  = note: required by `std::ops::Carrier::from_error`

error: aborting due to previous error

@eddyb says this can be improved by adding #[rustc_on_unimplemented = "the type{Self}cannot be used with?"] to something (maybe the Carrier trait.

crib off of fmt

cc @jonathandturner @nikomatsakis @nrc

@brson brson added A-diagnostics Area: Messages for errors, warnings, and lints E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. C-enhancement Category: An issue proposing an enhancement or a PR with one. I-papercut labels Nov 9, 2016
@nagisa
Copy link
Member

nagisa commented Nov 10, 2016

Duplicate of #35946

@steveklabnik
Copy link
Member

Yes, and on_unimplemented is in that thread as well.

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. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants