2020-05-17 10:22:48 +02:00
|
|
|
#![feature(specialization)] //~ WARN the feature `specialization` is incomplete
|
2020-01-09 05:56:38 -05:00
|
|
|
#![feature(negative_impls)]
|
2020-01-08 06:39:38 -05:00
|
|
|
|
|
|
|
// Negative impl for u32 cannot "specialize" the base impl.
|
2020-01-08 14:10:59 -05:00
|
|
|
trait MyTrait {}
|
|
|
|
impl<T> MyTrait for T {}
|
2020-04-22 20:18:22 +08:00
|
|
|
impl !MyTrait for u32 {} //~ ERROR E0751
|
2020-01-08 06:39:38 -05:00
|
|
|
|
|
|
|
// The second impl specializes the first, no error.
|
2020-01-08 14:10:59 -05:00
|
|
|
trait MyTrait2 {}
|
|
|
|
impl<T> MyTrait2 for T {}
|
|
|
|
impl MyTrait2 for u32 {}
|
2020-01-08 06:39:38 -05:00
|
|
|
|
2020-01-08 14:10:59 -05:00
|
|
|
fn main() {}
|