-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsT-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
I made a mistake while implementing Add for a type. Instead of using +
for specifying multiple constraints, I accidentally used ,
and for some reason the compiler can't handle this very well. Instead of complaining about the ,
it says that Add is not a Trait
struct Okok<T: Clone>(T);
use std::ops::Add;
impl<T: Clone, Add> Add for Okok<T> {
type Output = usize;
fn add(self, rhs: Self) -> Self::Output {
unimplemented!();
}
}
...
error[E0404]: `Add` is not a trait
--> <anon>:5:21
|
5 | impl<T: Clone, Add> Add for Okok<T> {
| ^^^ not a trait
error: cannot continue compilation due to previous error
This happens on both Nightly, Beta and Stable.
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsT-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.