File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -177,7 +177,6 @@ impl<'tcx> LateLintPass<'tcx> for TraitBounds {
177
177
bounds,
178
178
..
179
179
) ,
180
- span,
181
180
..
182
181
} ,
183
182
..
@@ -188,6 +187,12 @@ impl<'tcx> LateLintPass<'tcx> for TraitBounds {
188
187
return ;
189
188
}
190
189
190
+ let mut bounds_span = Span :: default ( ) ;
191
+
192
+ for bound in bounds. iter ( ) {
193
+ bounds_span = bounds_span. to ( bound. span ) ;
194
+ }
195
+
191
196
let mut seen_def_ids = FxHashSet :: default ( ) ;
192
197
193
198
let traits = bounds
@@ -205,7 +210,7 @@ impl<'tcx> LateLintPass<'tcx> for TraitBounds {
205
210
span_lint_and_sugg (
206
211
cx,
207
212
TRAIT_DUPLICATION_IN_BOUNDS ,
208
- * span ,
213
+ bounds_span ,
209
214
"this trait bound is already specified in trait declaration" ,
210
215
"consider removing this trait bound" ,
211
216
traits. clone ( ) ,
You can’t perform that action at this time.
0 commit comments