@@ -790,7 +790,7 @@ fn same_var<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, expr: &Expr, var: HirId) -> bo
790790 if path. segments. len( ) == 1 ;
791791 if let Def :: Local ( local_id) = cx. tables. qpath_def( qpath, expr. hir_id) ;
792792 // our variable!
793- if cx . tcx . hir ( ) . node_to_hir_id ( local_id) == var;
793+ if local_id == var;
794794 then {
795795 return true ;
796796 }
@@ -1657,13 +1657,13 @@ fn check_for_mutability(cx: &LateContext<'_, '_>, bound: &Expr) -> Option<HirId>
16571657 then {
16581658 let def = cx. tables. qpath_def( qpath, bound. hir_id) ;
16591659 if let Def :: Local ( node_id) = def {
1660- let node_str = cx. tcx. hir( ) . get ( node_id) ;
1660+ let node_str = cx. tcx. hir( ) . get_by_hir_id ( node_id) ;
16611661 if_chain! {
16621662 if let Node :: Binding ( pat) = node_str;
16631663 if let PatKind :: Binding ( bind_ann, ..) = pat. node;
16641664 if let BindingAnnotation :: Mutable = bind_ann;
16651665 then {
1666- return Some ( cx . tcx . hir ( ) . node_to_hir_id ( node_id) ) ;
1666+ return Some ( node_id) ;
16671667 }
16681668 }
16691669 }
@@ -1792,9 +1792,7 @@ impl<'a, 'tcx> VarVisitor<'a, 'tcx> {
17921792 }
17931793 let def = self . cx. tables. qpath_def( seqpath, seqexpr. hir_id) ;
17941794 match def {
1795- Def :: Local ( node_id) | Def :: Upvar ( node_id, ..) => {
1796- let hir_id = self . cx. tcx. hir( ) . node_to_hir_id( node_id) ;
1797-
1795+ Def :: Local ( hir_id) | Def :: Upvar ( hir_id, ..) => {
17981796 let parent_id = self . cx. tcx. hir( ) . get_parent_item( expr. hir_id) ;
17991797 let parent_def_id = self . cx. tcx. hir( ) . local_def_id_from_hir_id( parent_id) ;
18001798 let extent = self . cx. tcx. region_scope_tree( parent_def_id) . var_scope( hir_id. local_id) ;
@@ -1856,15 +1854,15 @@ impl<'a, 'tcx> Visitor<'tcx> for VarVisitor<'a, 'tcx> {
18561854 then {
18571855 match self . cx. tables. qpath_def( qpath, expr. hir_id) {
18581856 Def :: Upvar ( local_id, ..) => {
1859- if self . cx . tcx . hir ( ) . node_to_hir_id ( local_id) == self . var {
1857+ if local_id == self . var {
18601858 // we are not indexing anything, record that
18611859 self . nonindex = true ;
18621860 }
18631861 }
18641862 Def :: Local ( local_id) =>
18651863 {
18661864
1867- if self . cx . tcx . hir ( ) . node_to_hir_id ( local_id) == self . var {
1865+ if local_id == self . var {
18681866 self . nonindex = true ;
18691867 } else {
18701868 // not the correct variable, but still a variable
@@ -2209,7 +2207,7 @@ fn var_def_id(cx: &LateContext<'_, '_>, expr: &Expr) -> Option<HirId> {
22092207 if let ExprKind :: Path ( ref qpath) = expr. node {
22102208 let path_res = cx. tables . qpath_def ( qpath, expr. hir_id ) ;
22112209 if let Def :: Local ( node_id) = path_res {
2212- return Some ( cx . tcx . hir ( ) . node_to_hir_id ( node_id) ) ;
2210+ return Some ( node_id) ;
22132211 }
22142212 }
22152213 None
@@ -2404,7 +2402,7 @@ impl<'a, 'tcx> VarCollectorVisitor<'a, 'tcx> {
24042402 then {
24052403 match def {
24062404 Def :: Local ( node_id) | Def :: Upvar ( node_id, ..) => {
2407- self . ids. insert( self . cx . tcx . hir ( ) . node_to_hir_id ( node_id) ) ;
2405+ self . ids. insert( node_id) ;
24082406 } ,
24092407 Def :: Static ( def_id, mutable) => {
24102408 self . def_ids. insert( def_id, mutable) ;
0 commit comments