File tree 1 file changed +9
-2
lines changed 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -177,6 +177,7 @@ impl<'tcx> LateLintPass<'tcx> for TraitBounds {
177
177
bounds,
178
178
..
179
179
) ,
180
+ span,
180
181
..
181
182
} ,
182
183
..
@@ -189,6 +190,12 @@ impl<'tcx> LateLintPass<'tcx> for TraitBounds {
189
190
190
191
let mut seen_def_ids = FxHashSet :: default ( ) ;
191
192
193
+ let traits = bounds
194
+ . iter ( )
195
+ . filter_map ( |b| snippet_opt ( cx, b. span ) )
196
+ . collect :: < Vec < _ > > ( ) ;
197
+ let traits = traits. join ( " + " ) ;
198
+
192
199
for bound in bounds. iter ( ) {
193
200
let Some ( def_id) = bound. trait_ref . trait_def_id ( ) else { continue ; } ;
194
201
@@ -198,10 +205,10 @@ impl<'tcx> LateLintPass<'tcx> for TraitBounds {
198
205
span_lint_and_sugg (
199
206
cx,
200
207
TRAIT_DUPLICATION_IN_BOUNDS ,
201
- bound . span ,
208
+ * span,
202
209
"this trait bound is already specified in trait declaration" ,
203
210
"consider removing this trait bound" ,
204
- "" . to_string ( ) ,
211
+ traits . clone ( ) ,
205
212
Applicability :: MaybeIncorrect ,
206
213
) ;
207
214
}
You can’t perform that action at this time.
0 commit comments