@@ -41,8 +41,8 @@ declare_clippy_lint! {
4141declare_lint_pass ! ( FnArgMutRebindings => [ FN_ARG_MUT_REBINDINGS ] ) ;
4242
4343impl LateLintPass < ' _ > for FnArgMutRebindings {
44- fn check_local ( & mut self , ctx : & LateContext < ' _ > , st : & ' _ LetStmt < ' _ > ) {
45- if !st. span . in_external_macro ( ctx . tcx . sess . source_map ( ) )
44+ fn check_local ( & mut self , cx : & LateContext < ' _ > , st : & ' _ LetStmt < ' _ > ) {
45+ if !st. span . in_external_macro ( cx . tcx . sess . source_map ( ) )
4646
4747 // check let statement binds as mutable
4848 && let PatKind :: Binding ( BindingMode :: MUT , _, ident, None ) = st. pat . kind
@@ -55,11 +55,11 @@ impl LateLintPass<'_> for FnArgMutRebindings {
5555 && let Res :: Local ( id) = path. res
5656
5757 // check let statement scope is whole function body
58- && let Some ( ( _, owner) ) = ctx . tcx . hir_parent_owner_iter ( st. hir_id ) . next ( )
58+ && let Some ( ( _, owner) ) = cx . tcx . hir_parent_owner_iter ( st. hir_id ) . next ( )
5959 && let Some ( body_id) = fn_body_id ( & owner)
60- && let & Body { params, value } = ctx . tcx . hir_body ( body_id)
60+ && let & Body { params, value } = cx . tcx . hir_body ( body_id)
6161 && let ExprKind :: Block ( fn_block, _) = value. kind
62- && let Some ( st_block) = get_enclosing_block ( ctx , st. hir_id )
62+ && let Some ( st_block) = get_enclosing_block ( cx , st. hir_id )
6363 && fn_block. hir_id == st_block. hir_id
6464
6565 // check param declares as immutable
@@ -74,7 +74,7 @@ impl LateLintPass<'_> for FnArgMutRebindings {
7474 } ) = params. iter ( ) . find ( |p| p. pat . hir_id == id)
7575 {
7676 span_lint_and_then (
77- ctx ,
77+ cx ,
7878 FN_ARG_MUT_REBINDINGS ,
7979 pat_span,
8080 format ! (
@@ -85,7 +85,7 @@ impl LateLintPass<'_> for FnArgMutRebindings {
8585 diag. span_suggestion (
8686 pat_span,
8787 "consider just declaring as mutable" ,
88- format ! ( "mut {}" , snippet( ctx , pat_span, "_" ) ) ,
88+ format ! ( "mut {}" , snippet( cx , pat_span, "_" ) ) ,
8989 Applicability :: MaybeIncorrect ,
9090 ) ;
9191 diag. span_help ( st. span , "and remove this" ) ;
0 commit comments