summaryrefslogtreecommitdiffstats
path: root/src/test/ui/traits/negative-impls/negative-specializes-positive.rs
blob: 0e227691e0404e20186f2627ab651ba055215b6f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#![feature(specialization)] //~ WARN the feature `specialization` is incomplete
#![feature(negative_impls)]

// Negative impl for u32 cannot "specialize" the base impl.
trait MyTrait {}
impl<T> MyTrait for T {}
impl !MyTrait for u32 {} //~ ERROR E0751

// The second impl specializes the first, no error.
trait MyTrait2 {}
impl<T> MyTrait2 for T {}
impl MyTrait2 for u32 {}

fn main() {}