summaryrefslogtreecommitdiffstats
path: root/tests/ui/specialization/min_specialization/specialization_super_trait.rs
blob: 145f376edf938cf3e17bb7f3ff7a8d79e89b8c90 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// Test that supertraits can't be assumed in impls of
// `rustc_specialization_trait`, as such impls would
// allow specializing on the supertrait.

#![feature(min_specialization)]
#![feature(rustc_attrs)]

#[rustc_specialization_trait]
trait SpecMarker: Default {
    fn f();
}

impl<T: Default> SpecMarker for T {
    //~^ ERROR cannot specialize
    fn f() {}
}

fn main() {}