]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_error_codes/src/error_codes/E0751.md
Rollup merge of #93556 - dtolnay:trailingcomma, r=cjgillot
[rust.git] / compiler / rustc_error_codes / src / error_codes / E0751.md
1 There are both a positive and negative trait implementation for the same type.
2
3 Erroneous code example:
4
5 ```compile_fail,E0751
6 trait MyTrait {}
7 impl MyTrait for i32 { }
8 impl !MyTrait for i32 { } // error!
9 ```
10
11 Negative implementations are a promise that the trait will never be implemented
12 for the given types. Therefore, both cannot exists at the same time.