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