Skip to content

Commit 8db21e9

Browse files
committed
WIP
1 parent 0fb3f3b commit 8db21e9

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

clippy_lints/src/trait_bounds.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,6 @@ impl<'tcx> LateLintPass<'tcx> for TraitBounds {
177177
bounds,
178178
..
179179
),
180-
span,
181180
..
182181
},
183182
..
@@ -188,6 +187,12 @@ impl<'tcx> LateLintPass<'tcx> for TraitBounds {
188187
return;
189188
}
190189

190+
let mut bounds_span = Span::default();
191+
192+
for bound in bounds.iter() {
193+
bounds_span = bounds_span.to(bound.span);
194+
}
195+
191196
let mut seen_def_ids = FxHashSet::default();
192197

193198
let traits = bounds
@@ -205,7 +210,7 @@ impl<'tcx> LateLintPass<'tcx> for TraitBounds {
205210
span_lint_and_sugg(
206211
cx,
207212
TRAIT_DUPLICATION_IN_BOUNDS,
208-
*span,
213+
bounds_span,
209214
"this trait bound is already specified in trait declaration",
210215
"consider removing this trait bound",
211216
traits.clone(),

0 commit comments

Comments
 (0)