]> git.lizzy.rs Git - rust.git/blob - src/test/ui/specialization/min_specialization/dyn-trait-assoc-types.rs
Rollup merge of #70038 - DutchGhost:const-forget-tests, r=RalfJung
[rust.git] / src / test / ui / specialization / min_specialization / dyn-trait-assoc-types.rs
1 // Test that associated types in trait objects are not considered to be
2 // constrained.
3
4 #![feature(min_specialization)]
5
6 trait Specializable {
7     fn f();
8 }
9
10 trait B<T> {
11     type Y;
12 }
13
14 trait C {
15     type Y;
16 }
17
18 impl<A: ?Sized> Specializable for A {
19     default fn f() {}
20 }
21
22 impl<'a, T> Specializable for dyn B<T, Y = T> + 'a {
23     //~^ ERROR specializing impl repeats parameter `T`
24     fn f() {}
25 }
26
27 impl<'a, T> Specializable for dyn C<Y = (T, T)> + 'a {
28     //~^ ERROR specializing impl repeats parameter `T`
29     fn f() {}
30 }
31
32 fn main() {}