Closed
Description
impl std::ops::AddAssign for () {
fn add_assign(&self, other: ()) -> () {
()
}
}
produces:
error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
--> src/lib.rs:12:1
|
12 | impl std::ops::AddAssign for () {
| ^^^^^-------------------^^^^^--
| | | |
| | | this is not defined in the current crate because tuples are always foreign
| | this is not defined in the current crate because tuples are always foreign
| impl doesn't use only types from inside the current crate
|
= note: define and implement a trait or new type instead
Notice how it highlights std::ops::AddAssign
and says this is not defined in the current crate because tuples are always foreign
, despite AddAssign
have nothing to do with tuples.
Metadata
Metadata
Assignees
Labels
Area: Messages for errors, warnings, and lintsCategory: An issue proposing an enhancement or a PR with one.Diagnostics: Confusing error or lint that should be reworked.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Relevant to the compiler team, which will review and decide on the PR/issue.