Error code E0751

There are both a positive and negative trait implementation for the same type.

Erroneous code example:

trait MyTrait {}
impl MyTrait for i32 { }
impl !MyTrait for i32 { } // error!
Run

Negative implementations are a promise that the trait will never be implemented for the given types. Therefore, both cannot exists at the same time.

Back to list of error codes