@@ -973,10 +973,7 @@ fn get_details_from_idx<'tcx>(
973
973
ast:: LitKind :: Int ( x, _ty) => Some ( Sugg :: NonParen ( x. to_string ( ) . into ( ) ) ) ,
974
974
_ => None ,
975
975
} ,
976
- ExprKind :: Path ( ..) if get_start ( cx, e, starts) . is_none ( ) => {
977
- // `e` is always non paren as it's a `Path`
978
- Some ( Sugg :: NonParen ( snippet ( cx, e. span , "???" ) ) )
979
- } ,
976
+ ExprKind :: Path ( ..) if get_start ( cx, e, starts) . is_none ( ) => Some ( Sugg :: hir ( cx, e, "???" ) ) ,
980
977
_ => None ,
981
978
}
982
979
}
@@ -1010,8 +1007,7 @@ fn get_assignment<'tcx>(e: &'tcx Expr<'tcx>) -> Option<(&'tcx Expr<'tcx>, &'tcx
1010
1007
1011
1008
fn get_assignments < ' a : ' c , ' tcx : ' c , ' c > (
1012
1009
cx : & ' a LateContext < ' tcx > ,
1013
- stmts : & ' tcx [ Stmt < ' tcx > ] ,
1014
- expr : Option < & ' tcx Expr < ' tcx > > ,
1010
+ Block { stmts, expr, .. } : & ' tcx Block < ' tcx > ,
1015
1011
loop_counters : & ' c [ Start < ' tcx > ] ,
1016
1012
) -> impl Iterator < Item = Option < ( & ' tcx Expr < ' tcx > , & ' tcx Expr < ' tcx > ) > > + ' c {
1017
1013
stmts
@@ -1025,7 +1021,7 @@ fn get_assignments<'a: 'c, 'tcx: 'c, 'c>(
1025
1021
then { None } else { Some ( e) }
1026
1022
} ,
1027
1023
} )
1028
- . chain ( expr. into_iter ( ) )
1024
+ . chain ( ( * expr) . into_iter ( ) )
1029
1025
. map ( get_assignment)
1030
1026
}
1031
1027
@@ -1184,7 +1180,7 @@ fn detect_manual_memcpy<'tcx>(
1184
1180
if let Some ( loop_counters) = get_loop_counters ( cx, block, expr) {
1185
1181
starts. extend ( loop_counters) ;
1186
1182
}
1187
- iter_a = Some ( get_assignments ( cx, block. stmts , block . expr , & starts) ) ;
1183
+ iter_a = Some ( get_assignments ( cx, block, & starts) ) ;
1188
1184
} else {
1189
1185
iter_b = Some ( get_assignment ( body) ) ;
1190
1186
}
0 commit comments