rust/tests/ui/traits/negative-impls/negative-specializes-positive-item.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

14 lines
306 B
Rust
Raw Normal View History

2020-05-17 03:22:48 -05:00
#![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() {}
}
2020-04-22 07:18:22 -05:00
impl !MyTrait for u32 {} //~ ERROR E0751
fn main() {}