-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Cleanup E0749 #75328
Cleanup E0749 #75328
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,19 @@ | ||
Negative impls are not allowed to have any items. Negative impls | ||
declare that a trait is **not** implemented (and never will be) and | ||
hence there is no need to specify the values for trait methods or | ||
other items. | ||
An item was added on a negative impl. | ||
|
||
Erroneous code example: | ||
|
||
```compile_fail,E0749 | ||
# #![feature(negative_impls)] | ||
trait MyTrait { | ||
type Foo; | ||
} | ||
|
||
impl !MyTrait for u32 { | ||
type Foo = i32; // error! | ||
} | ||
# fn main() {} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we suggest how to fix this? Is it clear that the user should remove the type and put? impl !MyTrait for u32 {} There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hm it's verbose for me. "item" here is ambiguous a bit? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The explanation below isn't enough? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just enough but it is not as straightforward. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hum... I'm not sure to see what's missing so could please open a PR with your vision? (let's switch position for once! :p) Set me as reviewer on it so we can move forward quickly! :) |
||
``` | ||
|
||
Negative impls are not allowed to have any items. Negative impls declare that a | ||
trait is **not** implemented (and never will be) and hence there is no need to | ||
specify the values for trait methods or other items. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JohnTitor I think the "item" here like you said means "type". Should we change it?
The one below too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, "item" means "associated items" so I don't think we should change it.