@@ -28,32 +28,72 @@ LL | bar::<IntStruct>();
28
28
= note: expected reference `&usize`
29
29
found reference `&isize`
30
30
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
32
32
--> $DIR/associated-types-eq-hr.rs:96:5
33
33
|
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
39
40
...
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`
42
46
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
45
49
|
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
51
56
...
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`
54
94
55
95
error: 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
57
97
|
58
98
LL | / pub trait TheTrait<T> {
59
99
LL | | type A;
@@ -68,6 +108,6 @@ LL | tuple_four::<Tuple>();
68
108
= note: `Tuple` must implement `TheTrait<(&'0 isize, &'1 isize)>`, for any two lifetimes `'0` and `'1`...
69
109
= note: ...but `Tuple` actually implements `TheTrait<(&'2 isize, &'2 isize)>`, for some specific lifetime `'2`
70
110
71
- error: aborting due to 5 previous errors
111
+ error: aborting due to 7 previous errors
72
112
73
113
For more information about this error, try `rustc --explain E0271`.
0 commit comments