mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 01:04:03 +00:00
30 lines
507 B
Rust
30 lines
507 B
Rust
// Check that supertraits cannot be used to work around min_specialization
|
|
// limitations.
|
|
|
|
#![feature(min_specialization)]
|
|
#![feature(rustc_attrs)]
|
|
|
|
trait HasMethod {
|
|
fn method(&self);
|
|
}
|
|
|
|
#[rustc_unsafe_specialization_marker]
|
|
trait Marker: HasMethod {}
|
|
|
|
trait Spec {
|
|
fn spec_me(&self);
|
|
}
|
|
|
|
impl<T> Spec for T {
|
|
default fn spec_me(&self) {}
|
|
}
|
|
|
|
impl<T: Marker> Spec for T {
|
|
//~^ ERROR cannot specialize on trait `HasMethod`
|
|
fn spec_me(&self) {
|
|
self.method();
|
|
}
|
|
}
|
|
|
|
fn main() {}
|