rust/tests/ui/specialization/min_specialization/specialize_on_trait.rs

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

21 lines
302 B
Rust
Raw Normal View History

// Test that specializing on a trait is not allowed in general.
#![feature(min_specialization)]
trait SpecMarker {}
trait X {
fn f();
}
impl<T> X for T {
default fn f() {}
}
impl<T: SpecMarker> X for T {
//~^ ERROR cannot specialize on trait `SpecMarker`
fn f() {}
}
fn main() {}