@@ -28,32 +28,72 @@ LL | bar::<IntStruct>();
2828 = note: expected reference `&usize`
2929 found reference `&isize`
3030
31- error[E0271]: type mismatch resolving `for<'x, 'y> <Tuple as TheTrait<(&'x isize, &'y isize)>>::A == &'x isize`
31+ error: implementation of ` TheTrait` is not general enough
3232 --> $DIR/associated-types-eq-hr.rs:96:5
3333 |
34- LL | fn tuple_one<T>()
35- | --------- required by a bound in this
36- LL | where
37- LL | T: for<'x, 'y> TheTrait<(&'x isize, &'y isize), A = &'x isize>,
38- | ------------- required by this bound in `tuple_one`
34+ LL | / pub trait TheTrait<T> {
35+ LL | | type A;
36+ LL | |
37+ LL | | fn get(&self, t: T) -> Self::A;
38+ LL | | }
39+ | |_- trait `TheTrait` defined here
3940...
40- LL | tuple_one::<Tuple>();
41- | ^^^^^^^^^^^^^^^^^^ expected bound lifetime parameter 'x, found concrete lifetime
41+ LL | tuple_one::<Tuple>();
42+ | ^^^^^^^^^^^^^^^^^^ implementation of `TheTrait` is not general enough
43+ |
44+ = note: `Tuple` must implement `TheTrait<(&'0 isize, &'1 isize)>`, for any two lifetimes `'0` and `'1`...
45+ = note: ...but `Tuple` actually implements `TheTrait<(&'2 isize, &'2 isize)>`, for some specific lifetime `'2`
4246
43- error[E0271]: type mismatch resolving `for<'x, 'y> <Tuple as TheTrait<(&'x isize, &'y isize)>>::A == &'y isize`
44- --> $DIR/associated-types-eq-hr.rs:101 :5
47+ error: implementation of ` TheTrait` is not general enough
48+ --> $DIR/associated-types-eq-hr.rs:96 :5
4549 |
46- LL | fn tuple_two<T>()
47- | --------- required by a bound in this
48- LL | where
49- LL | T: for<'x, 'y> TheTrait<(&'x isize, &'y isize), A = &'y isize>,
50- | ------------- required by this bound in `tuple_two`
50+ LL | / pub trait TheTrait<T> {
51+ LL | | type A;
52+ LL | |
53+ LL | | fn get(&self, t: T) -> Self::A;
54+ LL | | }
55+ | |_- trait `TheTrait` defined here
5156...
52- LL | tuple_two::<Tuple>();
53- | ^^^^^^^^^^^^^^^^^^ expected bound lifetime parameter 'y, found concrete lifetime
57+ LL | tuple_one::<Tuple>();
58+ | ^^^^^^^^^^^^^^^^^^ implementation of `TheTrait` is not general enough
59+ |
60+ = note: `Tuple` must implement `TheTrait<(&'0 isize, &'1 isize)>`, for any two lifetimes `'0` and `'1`...
61+ = note: ...but `Tuple` actually implements `TheTrait<(&'2 isize, &'2 isize)>`, for some specific lifetime `'2`
62+
63+ error: implementation of `TheTrait` is not general enough
64+ --> $DIR/associated-types-eq-hr.rs:102:5
65+ |
66+ LL | / pub trait TheTrait<T> {
67+ LL | | type A;
68+ LL | |
69+ LL | | fn get(&self, t: T) -> Self::A;
70+ LL | | }
71+ | |_- trait `TheTrait` defined here
72+ ...
73+ LL | tuple_two::<Tuple>();
74+ | ^^^^^^^^^^^^^^^^^^ implementation of `TheTrait` is not general enough
75+ |
76+ = note: `Tuple` must implement `TheTrait<(&'0 isize, &'1 isize)>`, for any two lifetimes `'0` and `'1`...
77+ = note: ...but `Tuple` actually implements `TheTrait<(&'2 isize, &'2 isize)>`, for some specific lifetime `'2`
78+
79+ error: implementation of `TheTrait` is not general enough
80+ --> $DIR/associated-types-eq-hr.rs:102:5
81+ |
82+ LL | / pub trait TheTrait<T> {
83+ LL | | type A;
84+ LL | |
85+ LL | | fn get(&self, t: T) -> Self::A;
86+ LL | | }
87+ | |_- trait `TheTrait` defined here
88+ ...
89+ LL | tuple_two::<Tuple>();
90+ | ^^^^^^^^^^^^^^^^^^ implementation of `TheTrait` is not general enough
91+ |
92+ = note: `Tuple` must implement `TheTrait<(&'0 isize, &'1 isize)>`, for any two lifetimes `'0` and `'1`...
93+ = note: ...but `Tuple` actually implements `TheTrait<(&'2 isize, &'2 isize)>`, for some specific lifetime `'2`
5494
5595error: implementation of `TheTrait` is not general enough
56- --> $DIR/associated-types-eq-hr.rs:110 :5
96+ --> $DIR/associated-types-eq-hr.rs:112 :5
5797 |
5898LL | / pub trait TheTrait<T> {
5999LL | | type A;
@@ -68,6 +108,6 @@ LL | tuple_four::<Tuple>();
68108 = note: `Tuple` must implement `TheTrait<(&'0 isize, &'1 isize)>`, for any two lifetimes `'0` and `'1`...
69109 = note: ...but `Tuple` actually implements `TheTrait<(&'2 isize, &'2 isize)>`, for some specific lifetime `'2`
70110
71- error: aborting due to 5 previous errors
111+ error: aborting due to 7 previous errors
72112
73113For more information about this error, try `rustc --explain E0271`.
0 commit comments