@@ -6,6 +6,8 @@ impl Super for () {
6
6
}
7
7
trait Sub : Super < Assoc = u16 > { }
8
8
9
+ // direct impls (no nested obligations):
10
+
9
11
trait BoundOnSelf : Sub { }
10
12
impl BoundOnSelf for ( ) { }
11
13
//~^ ERROR the trait bound `(): Sub` is not satisfied
@@ -25,14 +27,41 @@ impl BoundOnAssoc for () {
25
27
trait BoundOnGat where Self :: Assoc < u8 > : Sub {
26
28
type Assoc < T > ;
27
29
}
28
- impl BoundOnGat for u8 {
30
+ impl BoundOnGat for ( ) {
29
31
type Assoc < T > = ( ) ;
30
32
//~^ ERROR the trait bound `(): Sub` is not satisfied
31
33
}
32
34
33
35
fn trivial_bound ( ) where ( ) : Sub { }
34
36
//~^ ERROR the trait bound `(): Sub` is not satisfied
35
37
38
+ // blanket impls with nested obligations:
39
+
40
+ struct Wrapper < T > ( T ) ;
41
+ impl < T : Super > Super for Wrapper < T > {
42
+ type Assoc = T :: Assoc ;
43
+ }
44
+ impl < T : Sub > Sub for Wrapper < T > { }
45
+
46
+ impl BoundOnSelf for Wrapper < ( ) > { }
47
+ //~^ ERROR the trait bound `(): Sub` is not satisfied
48
+
49
+ impl BoundOnParam < Wrapper < ( ) > > for Wrapper < ( ) > { }
50
+ //~^ ERROR the trait bound `(): Sub` is not satisfied
51
+
52
+ impl BoundOnAssoc for Wrapper < ( ) > {
53
+ type Assoc = Wrapper < ( ) > ;
54
+ //~^ ERROR the trait bound `(): Sub` is not satisfied
55
+ }
56
+
57
+ impl BoundOnGat for Wrapper < ( ) > {
58
+ type Assoc < T > = Wrapper < ( ) > ;
59
+ //~^ ERROR the trait bound `(): Sub` is not satisfied
60
+ }
61
+
62
+ fn trivial_bound_wrapper ( ) where Wrapper < ( ) > : Sub { }
63
+ //~^ ERROR the trait bound `(): Sub` is not satisfied
64
+
36
65
// The following is an edge case where the unsatisfied projection predicate
37
66
// `<<u8 as MultiAssoc>::Assoc1<()> as SuperGeneric<u16>>::Assoc == <u8 as MultiAssoc>::Assoc2`
38
67
// contains both associated types of `MultiAssoc`. To suppress the error about the unsatisfied
0 commit comments