@@ -182,7 +182,7 @@ impl<'tcx> LateLintPass<'tcx> for TraitBounds {
182
182
183
183
// Iterate the bounds and add them to our seen hash
184
184
// If we haven't yet seen it, add it to the fixed traits
185
- for ( bound, _ ) in bounds {
185
+ for bound in bounds {
186
186
let Some ( def_id) = bound. trait_ref . trait_def_id ( ) else {
187
187
continue ;
188
188
} ;
@@ -197,9 +197,9 @@ impl<'tcx> LateLintPass<'tcx> for TraitBounds {
197
197
// If the number of unique traits isn't the same as the number of traits in the bounds,
198
198
// there must be 1 or more duplicates
199
199
if bounds. len ( ) != unique_traits. len ( ) {
200
- let mut bounds_span = bounds[ 0 ] . 0 . span ;
200
+ let mut bounds_span = bounds[ 0 ] . span ;
201
201
202
- for ( bound, _ ) in bounds. iter ( ) . skip ( 1 ) {
202
+ for bound in bounds. iter ( ) . skip ( 1 ) {
203
203
bounds_span = bounds_span. to ( bound. span ) ;
204
204
}
205
205
@@ -229,7 +229,8 @@ impl TraitBounds {
229
229
/// this MSRV? See <https://github.com/rust-lang/rust-clippy/issues/8772> for details.
230
230
fn cannot_combine_maybe_bound ( & self , cx : & LateContext < ' _ > , bound : & GenericBound < ' _ > ) -> bool {
231
231
if !self . msrv . meets ( msrvs:: MAYBE_BOUND_IN_WHERE )
232
- && let GenericBound :: Trait ( tr, TraitBoundModifier :: Maybe ) = bound
232
+ && let GenericBound :: Trait ( tr) = bound
233
+ && let TraitBoundModifier :: Maybe = tr. modifiers
233
234
{
234
235
cx. tcx . lang_items ( ) . get ( LangItem :: Sized ) == tr. trait_ref . path . res . opt_def_id ( )
235
236
} else {
@@ -375,11 +376,11 @@ impl Default for ComparableTraitRef {
375
376
}
376
377
377
378
fn get_trait_info_from_bound < ' a > ( bound : & ' a GenericBound < ' _ > ) -> Option < ( Res , & ' a [ PathSegment < ' a > ] , Span ) > {
378
- if let GenericBound :: Trait ( t, tbm ) = bound {
379
+ if let GenericBound :: Trait ( t) = bound {
379
380
let trait_path = t. trait_ref . path ;
380
381
let trait_span = {
381
382
let path_span = trait_path. span ;
382
- if let TraitBoundModifier :: Maybe = tbm {
383
+ if let TraitBoundModifier :: Maybe = t . modifiers {
383
384
path_span. with_lo ( path_span. lo ( ) - BytePos ( 1 ) ) // include the `?`
384
385
} else {
385
386
path_span
@@ -430,7 +431,7 @@ fn rollup_traits(
430
431
let mut repeated_res = false ;
431
432
432
433
let only_comparable_trait_refs = |bound : & GenericBound < ' _ > | {
433
- if let GenericBound :: Trait ( t, _ ) = bound {
434
+ if let GenericBound :: Trait ( t) = bound {
434
435
Some ( ( into_comparable_trait_ref ( & t. trait_ref ) , t. span ) )
435
436
} else {
436
437
None
0 commit comments