We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0fb3f3b commit 8db21e9Copy full SHA for 8db21e9
clippy_lints/src/trait_bounds.rs
@@ -177,7 +177,6 @@ impl<'tcx> LateLintPass<'tcx> for TraitBounds {
177
bounds,
178
..
179
),
180
- span,
181
182
},
183
@@ -188,6 +187,12 @@ impl<'tcx> LateLintPass<'tcx> for TraitBounds {
188
187
return;
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
196
let mut seen_def_ids = FxHashSet::default();
197
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",
215
"consider removing this trait bound",
216
traits.clone(),
0 commit comments