]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_error_codes/src/error_codes/E0750.md
Rollup merge of #93556 - dtolnay:trailingcomma, r=cjgillot
[rust.git] / compiler / rustc_error_codes / src / error_codes / E0750.md
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.