@@ -6,6 +6,8 @@ impl Super for () {
66}
77trait Sub : Super < Assoc = u16 > { }
88
9+ // direct impls (no nested obligations):
10+
911trait BoundOnSelf : Sub { }
1012impl BoundOnSelf for ( ) { }
1113//~^ ERROR the trait bound `(): Sub` is not satisfied
@@ -25,14 +27,41 @@ impl BoundOnAssoc for () {
2527trait BoundOnGat where Self :: Assoc < u8 > : Sub {
2628 type Assoc < T > ;
2729}
28- impl BoundOnGat for u8 {
30+ impl BoundOnGat for ( ) {
2931 type Assoc < T > = ( ) ;
3032 //~^ ERROR the trait bound `(): Sub` is not satisfied
3133}
3234
3335fn trivial_bound ( ) where ( ) : Sub { }
3436//~^ ERROR the trait bound `(): Sub` is not satisfied
3537
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+
3665// The following is an edge case where the unsatisfied projection predicate
3766// `<<u8 as MultiAssoc>::Assoc1<()> as SuperGeneric<u16>>::Assoc == <u8 as MultiAssoc>::Assoc2`
3867// contains both associated types of `MultiAssoc`. To suppress the error about the unsatisfied
0 commit comments