File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff 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 ( ) ,
You can’t perform that action at this time.
0 commit comments