21 lines
302 B
Rust
21 lines
302 B
Rust
|
// 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() {}
|