mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-02 11:44:28 +00:00
WIP
This commit is contained in:
parent
0fb3f3b256
commit
8db21e9a9c
@ -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…
Reference in New Issue
Block a user