]> git.lizzy.rs Git - rust.git/blob - src/test/ui/traits/negative-impls/negative-specializes-positive.rs
1939a098b50ee08aa8d892f7e38cc5459b486a49
[rust.git] / src / test / ui / traits / negative-impls / negative-specializes-positive.rs
1 #![feature(specialization)]
2 #![feature(negative_impls)]
3
4 // Negative impl for u32 cannot "specialize" the base impl.
5 trait MyTrait {}
6 impl<T> MyTrait for T {}
7 impl !MyTrait for u32 {} //~ ERROR E0751
8
9 // The second impl specializes the first, no error.
10 trait MyTrait2 {}
11 impl<T> MyTrait2 for T {}
12 impl MyTrait2 for u32 {}
13
14 fn main() {}