summaryrefslogtreecommitdiffstats
path: root/compiler/rustc_error_codes/src/error_codes/E0750.md
blob: 905e852f8d579e60e9984aa12fea4e42adb1ca81 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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.