@@ -107,7 +107,71 @@ LL | type Y<'a>;
107
107
| ^ ...because it contains the generic associated type `Y`
108
108
= help: consider moving `Y` to another trait
109
109
110
- error: aborting due to 7 previous errors
110
+ error[E0107]: associated type takes 1 lifetime argument but 0 lifetime arguments were supplied
111
+ --> $DIR/issue-102768.rs:9:30
112
+ |
113
+ LL | fn f2<'a>(arg: Box<dyn X<Y<1> = &'a ()>>) {}
114
+ | ^ expected 1 lifetime argument
115
+ |
116
+ note: associated type defined here, with 1 lifetime parameter: `'a`
117
+ --> $DIR/issue-102768.rs:5:10
118
+ |
119
+ LL | type Y<'a>;
120
+ | ^ --
121
+ = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
122
+ help: add missing lifetime argument
123
+ |
124
+ LL | fn f2<'a>(arg: Box<dyn X<Y<'_, 1> = &'a ()>>) {}
125
+ | +++
126
+
127
+ error[E0107]: associated type takes 0 generic arguments but 1 generic argument was supplied
128
+ --> $DIR/issue-102768.rs:9:30
129
+ |
130
+ LL | fn f2<'a>(arg: Box<dyn X<Y<1> = &'a ()>>) {}
131
+ | ^--- help: remove these generics
132
+ | |
133
+ | expected 0 generic arguments
134
+ |
135
+ note: associated type defined here, with 0 generic parameters
136
+ --> $DIR/issue-102768.rs:5:10
137
+ |
138
+ LL | type Y<'a>;
139
+ | ^
140
+ = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
141
+
142
+ error[E0107]: associated type takes 1 lifetime argument but 0 lifetime arguments were supplied
143
+ --> $DIR/issue-102768.rs:9:30
144
+ |
145
+ LL | fn f2<'a>(arg: Box<dyn X<Y<1> = &'a ()>>) {}
146
+ | ^ expected 1 lifetime argument
147
+ |
148
+ note: associated type defined here, with 1 lifetime parameter: `'a`
149
+ --> $DIR/issue-102768.rs:5:10
150
+ |
151
+ LL | type Y<'a>;
152
+ | ^ --
153
+ = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
154
+ help: add missing lifetime argument
155
+ |
156
+ LL | fn f2<'a>(arg: Box<dyn X<Y<'_, 1> = &'a ()>>) {}
157
+ | +++
158
+
159
+ error[E0107]: associated type takes 0 generic arguments but 1 generic argument was supplied
160
+ --> $DIR/issue-102768.rs:9:30
161
+ |
162
+ LL | fn f2<'a>(arg: Box<dyn X<Y<1> = &'a ()>>) {}
163
+ | ^--- help: remove these generics
164
+ | |
165
+ | expected 0 generic arguments
166
+ |
167
+ note: associated type defined here, with 0 generic parameters
168
+ --> $DIR/issue-102768.rs:5:10
169
+ |
170
+ LL | type Y<'a>;
171
+ | ^
172
+ = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
173
+
174
+ error: aborting due to 11 previous errors
111
175
112
176
Some errors have detailed explanations: E0038, E0107.
113
177
For more information about an error, try `rustc --explain E0038`.
0 commit comments