-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #75291 - GuillaumeGomez:cleanup-e0750, r=pickfire
Clean up E0750 r? @Dylan-DPC
- Loading branch information
Showing
2 changed files
with
19 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,18 @@ | ||
Negative impls cannot be default impls. A default impl supplies | ||
default values for the items within to be used by other impls, whereas | ||
a negative impl declares that there are no other impls. These don't | ||
make sense to combine. | ||
A negative impl was made default impl. | ||
|
||
Erroneous code example: | ||
|
||
```compile_fail,E0750 | ||
# #![feature(negative_impls)] | ||
# #![feature(specialization)] | ||
trait MyTrait { | ||
type Foo; | ||
} | ||
default impl !MyTrait for u32 {} // error! | ||
# fn main() {} | ||
``` | ||
|
||
Negative impls cannot be default impls. A default impl supplies default values | ||
for the items within to be used by other impls, whereas a negative impl declares | ||
that there are no other impls. Combining it does not make sense. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters