-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
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
sanmai-NL and anqur
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.