WIP
This commit is contained in:
parent
0fb3f3b256
commit
8db21e9a9c
1 changed files with 7 additions and 2 deletions
|
|
@ -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(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue