Skip to content

Commit 259d350

Browse files
Clean up E0750 explanation
1 parent d19d7e2 commit 259d350

File tree

1 file changed

+18
-4
lines changed
  • src/librustc_error_codes/error_codes

1 file changed

+18
-4
lines changed
Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,18 @@
1-
Negative impls cannot be default impls. A default impl supplies
2-
default values for the items within to be used by other impls, whereas
3-
a negative impl declares that there are no other impls. These don't
4-
make sense to combine.
1+
A negative impl was made default impl.
2+
3+
Erroneous code example:
4+
5+
```compile_fail,E0750
6+
# #![feature(negative_impls)]
7+
# #![feature(specialization)]
8+
trait MyTrait {
9+
type Foo;
10+
}
11+
12+
default impl !MyTrait for u32 {} // error!
13+
# fn main() {}
14+
```
15+
16+
Negative impls cannot be default impls. A default impl supplies default values
17+
for the items within to be used by other impls, whereas a negative impl declares
18+
that there are no other impls. Combining it does not make sense.

0 commit comments

Comments
 (0)