]> git.lizzy.rs Git - rust.git/blob - src/test/ui/associated-type-bounds/issue-73818.rs
Merge commit '3e7c6dec244539970b593824334876f8b6ed0b18' into clippyup
[rust.git] / src / test / ui / associated-type-bounds / issue-73818.rs
1 // Test that associated type bounds are correctly normalized when checking
2 // default associated type values.
3 // check-pass
4
5 #![allow(incomplete_features)]
6 #![feature(specialization)]
7
8 #[derive(PartialEq)]
9 enum Never {}
10 trait Foo {
11     type Assoc: PartialEq; // PartialEq<<Self as Foo>::Assoc>
12 }
13 impl<T> Foo for T {
14     default type Assoc = Never;
15 }
16
17 trait Trait1 {
18     type Selection: PartialEq;
19 }
20 trait Trait2: PartialEq<Self> {}
21 impl<T: Trait2> Trait1 for T {
22     default type Selection = T;
23 }
24
25 fn main() {}