Skip to content

Commit

Permalink
Clean up E0750 explanation
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Aug 8, 2020
1 parent d19d7e2 commit 259d350
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions src/librustc_error_codes/error_codes/E0750.md
@@ -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.

0 comments on commit 259d350

Please sign in to comment.