mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-18 11:34:11 +00:00
15 lines
371 B
Rust
15 lines
371 B
Rust
|
#![feature(specialization)]
|
||
|
#![feature(optin_builtin_traits)]
|
||
|
|
||
|
// Negative impl for u32 cannot "specialize" the base impl.
|
||
|
trait MyTrait { }
|
||
|
impl<T> MyTrait for T { }
|
||
|
impl !MyTrait for u32 { } //~ ERROR conflicting implementations
|
||
|
|
||
|
// The second impl specializes the first, no error.
|
||
|
trait MyTrait2 { }
|
||
|
impl<T> MyTrait2 for T { }
|
||
|
impl MyTrait2 for u32 { }
|
||
|
|
||
|
fn main() { }
|