summaryrefslogtreecommitdiffstats
path: root/tests/ui/specialization/min_specialization/dyn-trait-assoc-types.rs
blob: 03cab00b0fb965cf2680726b22b590e77d6f46fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Test that associated types in trait objects are not considered to be
// constrained.

#![feature(min_specialization)]

trait Specializable {
    fn f();
}

trait B<T> {
    type Y;
}

trait C {
    type Y;
}

impl<A: ?Sized> Specializable for A {
    default fn f() {}
}

impl<'a, T> Specializable for dyn B<T, Y = T> + 'a {
    //~^ ERROR specializing impl repeats parameter `T`
    fn f() {}
}

impl<'a, T> Specializable for dyn C<Y = (T, T)> + 'a {
    //~^ ERROR specializing impl repeats parameter `T`
    fn f() {}
}

fn main() {}