@@ -182,7 +182,7 @@ impl<'tcx> LateLintPass<'tcx> for TraitBounds {
182182
183183 // Iterate the bounds and add them to our seen hash
184184 // If we haven't yet seen it, add it to the fixed traits
185- for ( bound, _ ) in bounds {
185+ for bound in bounds {
186186 let Some ( def_id) = bound. trait_ref . trait_def_id ( ) else {
187187 continue ;
188188 } ;
@@ -197,9 +197,9 @@ impl<'tcx> LateLintPass<'tcx> for TraitBounds {
197197 // If the number of unique traits isn't the same as the number of traits in the bounds,
198198 // there must be 1 or more duplicates
199199 if bounds. len ( ) != unique_traits. len ( ) {
200- let mut bounds_span = bounds[ 0 ] . 0 . span ;
200+ let mut bounds_span = bounds[ 0 ] . span ;
201201
202- for ( bound, _ ) in bounds. iter ( ) . skip ( 1 ) {
202+ for bound in bounds. iter ( ) . skip ( 1 ) {
203203 bounds_span = bounds_span. to ( bound. span ) ;
204204 }
205205
@@ -229,7 +229,8 @@ impl TraitBounds {
229229 /// this MSRV? See <https://github.com/rust-lang/rust-clippy/issues/8772> for details.
230230 fn cannot_combine_maybe_bound ( & self , cx : & LateContext < ' _ > , bound : & GenericBound < ' _ > ) -> bool {
231231 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
233234 {
234235 cx. tcx . lang_items ( ) . get ( LangItem :: Sized ) == tr. trait_ref . path . res . opt_def_id ( )
235236 } else {
@@ -375,11 +376,11 @@ impl Default for ComparableTraitRef {
375376}
376377
377378fn 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 {
379380 let trait_path = t. trait_ref . path ;
380381 let trait_span = {
381382 let path_span = trait_path. span ;
382- if let TraitBoundModifier :: Maybe = tbm {
383+ if let TraitBoundModifier :: Maybe = t . modifiers {
383384 path_span. with_lo ( path_span. lo ( ) - BytePos ( 1 ) ) // include the `?`
384385 } else {
385386 path_span
@@ -430,7 +431,7 @@ fn rollup_traits(
430431 let mut repeated_res = false ;
431432
432433 let only_comparable_trait_refs = |bound : & GenericBound < ' _ > | {
433- if let GenericBound :: Trait ( t, _ ) = bound {
434+ if let GenericBound :: Trait ( t) = bound {
434435 Some ( ( into_comparable_trait_ref ( & t. trait_ref ) , t. span ) )
435436 } else {
436437 None
0 commit comments