]> git.proxmox.com Git - rustc.git/blob - src/librustc_error_codes/error_codes/E0751.md
New upstream version 1.47.0+dfsg1
[rustc.git] / src / librustc_error_codes / 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.