This commit is contained in:
John Kelly 2023-04-30 14:14:47 +01:00
parent 0fb3f3b256
commit 8db21e9a9c

View File

@ -177,7 +177,6 @@ impl<'tcx> LateLintPass<'tcx> for TraitBounds {
bounds,
..
),
span,
..
},
..
@ -188,6 +187,12 @@ impl<'tcx> LateLintPass<'tcx> for TraitBounds {
return;
}
let mut bounds_span = Span::default();
for bound in bounds.iter() {
bounds_span = bounds_span.to(bound.span);
}
let mut seen_def_ids = FxHashSet::default();
let traits = bounds
@ -205,7 +210,7 @@ impl<'tcx> LateLintPass<'tcx> for TraitBounds {
span_lint_and_sugg(
cx,
TRAIT_DUPLICATION_IN_BOUNDS,
*span,
bounds_span,
"this trait bound is already specified in trait declaration",
"consider removing this trait bound",
traits.clone(),