@@ -6,9 +6,9 @@ use crate::utils::visitors::LocalUsedVisitor;
66use crate :: utils:: {
77 contains_name, get_enclosing_block, get_parent_expr, get_trait_def_id, has_iter_method, higher, implements_trait,
88 indent_of, is_in_panic_handler, is_integer_const, is_no_std_crate, is_refutable, is_type_diagnostic_item,
9- last_path_segment, match_trait_method, match_type, match_var, multispan_sugg, qpath_res , single_segment_path ,
10- snippet , snippet_with_applicability, snippet_with_macro_callsite, span_lint, span_lint_and_help,
11- span_lint_and_sugg , span_lint_and_then, sugg, SpanlessEq ,
9+ last_path_segment, match_trait_method, match_type, match_var, multispan_sugg, single_segment_path , snippet ,
10+ snippet_with_applicability, snippet_with_macro_callsite, span_lint, span_lint_and_help, span_lint_and_sugg ,
11+ span_lint_and_then, sugg, SpanlessEq ,
1212} ;
1313use if_chain:: if_chain;
1414use rustc_ast:: ast;
@@ -848,7 +848,7 @@ fn same_var<'tcx>(cx: &LateContext<'tcx>, expr: &Expr<'_>, var: HirId) -> bool {
848848 if let ExprKind :: Path ( qpath) = & expr. kind;
849849 if let QPath :: Resolved ( None , path) = qpath;
850850 if path. segments. len( ) == 1 ;
851- if let Res :: Local ( local_id) = qpath_res( cx , qpath, expr. hir_id) ;
851+ if let Res :: Local ( local_id) = cx . qpath_res( qpath, expr. hir_id) ;
852852 then {
853853 // our variable!
854854 local_id == var
@@ -1420,7 +1420,7 @@ fn detect_same_item_push<'tcx>(
14201420 // Make sure that the push does not involve possibly mutating values
14211421 match pushed_item. kind {
14221422 ExprKind :: Path ( ref qpath) => {
1423- match qpath_res ( cx , qpath, pushed_item. hir_id ) {
1423+ match cx . qpath_res ( qpath, pushed_item. hir_id ) {
14241424 // immutable bindings that are initialized with literal or constant
14251425 Res :: Local ( hir_id) => {
14261426 if_chain ! {
@@ -1437,7 +1437,7 @@ fn detect_same_item_push<'tcx>(
14371437 ExprKind :: Lit ( ..) => emit_lint( cx, vec, pushed_item) ,
14381438 // immutable bindings that are initialized with constant
14391439 ExprKind :: Path ( ref path) => {
1440- if let Res :: Def ( DefKind :: Const , ..) = qpath_res( cx , path, init. hir_id) {
1440+ if let Res :: Def ( DefKind :: Const , ..) = cx . qpath_res( path, init. hir_id) {
14411441 emit_lint( cx, vec, pushed_item) ;
14421442 }
14431443 }
@@ -2028,7 +2028,7 @@ fn check_for_mutability(cx: &LateContext<'_>, bound: &Expr<'_>) -> Option<HirId>
20282028 if let ExprKind :: Path ( ref qpath) = bound. kind;
20292029 if let QPath :: Resolved ( None , _) = * qpath;
20302030 then {
2031- let res = qpath_res( cx , qpath, bound. hir_id) ;
2031+ let res = cx . qpath_res( qpath, bound. hir_id) ;
20322032 if let Res :: Local ( hir_id) = res {
20332033 let node_str = cx. tcx. hir( ) . get( hir_id) ;
20342034 if_chain! {
@@ -2120,7 +2120,7 @@ impl<'a, 'tcx> VarVisitor<'a, 'tcx> {
21202120 if self . prefer_mutable {
21212121 self . indexed_mut. insert( seqvar. segments[ 0 ] . ident. name) ;
21222122 }
2123- let res = qpath_res ( self . cx, seqpath, seqexpr. hir_id) ;
2123+ let res = self . cx. qpath_res ( seqpath, seqexpr. hir_id) ;
21242124 match res {
21252125 Res :: Local ( hir_id) => {
21262126 let parent_id = self . cx. tcx. hir( ) . get_parent_item( expr. hir_id) ;
@@ -2184,7 +2184,7 @@ impl<'a, 'tcx> Visitor<'tcx> for VarVisitor<'a, 'tcx> {
21842184 if let QPath :: Resolved ( None , ref path) = * qpath;
21852185 if path. segments. len( ) == 1 ;
21862186 then {
2187- if let Res :: Local ( local_id) = qpath_res ( self . cx, qpath, expr. hir_id) {
2187+ if let Res :: Local ( local_id) = self . cx. qpath_res ( qpath, expr. hir_id) {
21882188 if local_id == self . var {
21892189 self . nonindex = true ;
21902190 } else {
@@ -2589,7 +2589,7 @@ impl<'a, 'tcx> Visitor<'tcx> for InitializeVisitor<'a, 'tcx> {
25892589
25902590fn var_def_id ( cx : & LateContext < ' _ > , expr : & Expr < ' _ > ) -> Option < HirId > {
25912591 if let ExprKind :: Path ( ref qpath) = expr. kind {
2592- let path_res = qpath_res ( cx , qpath, expr. hir_id ) ;
2592+ let path_res = cx . qpath_res ( qpath, expr. hir_id ) ;
25932593 if let Res :: Local ( hir_id) = path_res {
25942594 return Some ( hir_id) ;
25952595 }
@@ -2819,7 +2819,7 @@ impl<'a, 'tcx> VarCollectorVisitor<'a, 'tcx> {
28192819 if_chain ! {
28202820 if let ExprKind :: Path ( ref qpath) = ex. kind;
28212821 if let QPath :: Resolved ( None , _) = * qpath;
2822- let res = qpath_res ( self . cx, qpath, ex. hir_id) ;
2822+ let res = self . cx. qpath_res ( qpath, ex. hir_id) ;
28232823 then {
28242824 match res {
28252825 Res :: Local ( hir_id) => {
0 commit comments