2020-01-08 05:39:38 -06:00
|
|
|
#![feature(specialization)]
|
|
|
|
#![feature(optin_builtin_traits)]
|
|
|
|
|
|
|
|
// Negative impl for u32 cannot "specialize" the base impl.
|
2020-01-08 13:10:59 -06:00
|
|
|
trait MyTrait {}
|
|
|
|
impl<T> MyTrait for T {}
|
|
|
|
impl !MyTrait for u32 {} //~ ERROR E0748
|
2020-01-08 05:39:38 -06:00
|
|
|
|
|
|
|
// The second impl specializes the first, no error.
|
2020-01-08 13:10:59 -06:00
|
|
|
trait MyTrait2 {}
|
|
|
|
impl<T> MyTrait2 for T {}
|
|
|
|
impl MyTrait2 for u32 {}
|
2020-01-08 05:39:38 -06:00
|
|
|
|
2020-01-08 13:10:59 -06:00
|
|
|
fn main() {}
|