rust/tests/ui/traits/negative-impls/negative-specializes-positive-item.rs
2023-01-11 09:32:08 +00:00

14 lines
306 B
Rust

#![feature(specialization)] //~ WARN the feature `specialization` is incomplete
#![feature(negative_impls)]
// Negative impl for u32 cannot "specialize" the base impl.
trait MyTrait {
fn foo();
}
impl<T> MyTrait for T {
default fn foo() {}
}
impl !MyTrait for u32 {} //~ ERROR E0751
fn main() {}