Clean up E0750 explanation
This commit is contained in:
parent
d19d7e2755
commit
259d350111
1 changed files with 18 additions and 4 deletions
|
@ -1,4 +1,18 @@
|
||||||
Negative impls cannot be default impls. A default impl supplies
|
A negative impl was made default impl.
|
||||||
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
|
Erroneous code example:
|
||||||
make sense to combine.
|
|
||||||
|
```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.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue