@@ -30,7 +30,7 @@ use rustc_middle::ty::{
3030} ; 
3131use  rustc_semver:: RustcVersion ; 
3232use  rustc_session:: { declare_tool_lint,  impl_lint_pass} ; 
33- use  rustc_span:: { symbol:: sym,  Span ,  Symbol ,   DUMMY_SP } ; 
33+ use  rustc_span:: { symbol:: sym,  Span ,  Symbol } ; 
3434use  rustc_trait_selection:: infer:: InferCtxtExt  as  _; 
3535use  rustc_trait_selection:: traits:: { query:: evaluate_obligation:: InferCtxtExt  as  _,  Obligation ,  ObligationCause } ; 
3636use  std:: collections:: VecDeque ; 
@@ -714,47 +714,47 @@ fn walk_parents<'tcx>(
714714            } , 
715715            Node :: Item ( & Item  { 
716716                kind :  ItemKind :: Static ( ..)  | ItemKind :: Const ( ..) , 
717-                 def_id , 
717+                 owner_id , 
718718                span, 
719719                ..
720720            } ) 
721721            | Node :: TraitItem ( & TraitItem  { 
722722                kind :  TraitItemKind :: Const ( ..) , 
723-                 def_id , 
723+                 owner_id , 
724724                span, 
725725                ..
726726            } ) 
727727            | Node :: ImplItem ( & ImplItem  { 
728728                kind :  ImplItemKind :: Const ( ..) , 
729-                 def_id , 
729+                 owner_id , 
730730                span, 
731731                ..
732732            } )  if  span. ctxt ( )  == ctxt => { 
733-                 let  ty = cx. tcx . type_of ( def_id . def_id ) ; 
733+                 let  ty = cx. tcx . type_of ( owner_id . def_id ) ; 
734734                Some ( ty_auto_deref_stability ( cx,  ty,  precedence) . position_for_result ( cx) ) 
735735            } , 
736736
737737            Node :: Item ( & Item  { 
738738                kind :  ItemKind :: Fn ( ..) , 
739-                 def_id , 
739+                 owner_id , 
740740                span, 
741741                ..
742742            } ) 
743743            | Node :: TraitItem ( & TraitItem  { 
744744                kind :  TraitItemKind :: Fn ( ..) , 
745-                 def_id , 
745+                 owner_id , 
746746                span, 
747747                ..
748748            } ) 
749749            | Node :: ImplItem ( & ImplItem  { 
750750                kind :  ImplItemKind :: Fn ( ..) , 
751-                 def_id , 
751+                 owner_id , 
752752                span, 
753753                ..
754754            } )  if  span. ctxt ( )  == ctxt => { 
755755                let  output = cx
756756                    . tcx 
757-                     . erase_late_bound_regions ( cx. tcx . fn_sig ( def_id . to_def_id ( ) ) . output ( ) ) ; 
757+                     . erase_late_bound_regions ( cx. tcx . fn_sig ( owner_id . to_def_id ( ) ) . output ( ) ) ; 
758758                Some ( ty_auto_deref_stability ( cx,  output,  precedence) . position_for_result ( cx) ) 
759759            } , 
760760
@@ -1000,7 +1000,7 @@ fn binding_ty_auto_deref_stability<'tcx>(
10001000                                cx. typeck_results ( ) . node_type ( ty. ty . hir_id ) , 
10011001                                binder_args, 
10021002                            ) ) 
1003-                             . is_sized ( cx. tcx . at ( DUMMY_SP ) ,  cx. param_env . without_caller_bounds ( ) ) , 
1003+                             . is_sized ( cx. tcx ,  cx. param_env . without_caller_bounds ( ) ) , 
10041004                    ) 
10051005                } 
10061006            } , 
@@ -1015,7 +1015,7 @@ fn binding_ty_auto_deref_stability<'tcx>(
10151015                        cx. typeck_results ( ) . node_type ( ty. ty . hir_id ) , 
10161016                        binder_args, 
10171017                    ) ) 
1018-                     . is_sized ( cx. tcx . at ( DUMMY_SP ) ,  cx. param_env . without_caller_bounds ( ) ) , 
1018+                     . is_sized ( cx. tcx ,  cx. param_env . without_caller_bounds ( ) ) , 
10191019            ) , 
10201020            TyKind :: OpaqueDef ( ..)  | TyKind :: Infer  | TyKind :: Typeof ( ..)  | TyKind :: TraitObject ( ..)  | TyKind :: Err  => { 
10211021                Position :: ReborrowStable ( precedence) 
@@ -1116,7 +1116,7 @@ fn needless_borrow_impl_arg_position<'tcx>(
11161116        . iter ( ) 
11171117        . filter_map ( |predicate| { 
11181118            if  let  PredicateKind :: Trait ( trait_predicate)  = predicate. kind ( ) . skip_binder ( ) 
1119-                 && trait_predicate. self_ty ( )  == param_ty. to_ty ( cx. tcx ) 
1119+                 && trait_predicate. trait_ref . self_ty ( )  == param_ty. to_ty ( cx. tcx ) 
11201120            { 
11211121                Some ( trait_predicate. trait_ref . def_id ) 
11221122            }  else  { 
@@ -1188,7 +1188,7 @@ fn needless_borrow_impl_arg_position<'tcx>(
11881188            } 
11891189
11901190            let  predicate = EarlyBinder ( predicate) . subst ( cx. tcx ,  & substs_with_referent_ty) ; 
1191-             let  obligation = Obligation :: new ( ObligationCause :: dummy ( ) ,  cx. param_env ,  predicate) ; 
1191+             let  obligation = Obligation :: new ( cx . tcx ,   ObligationCause :: dummy ( ) ,  cx. param_env ,  predicate) ; 
11921192            let  infcx = cx. tcx . infer_ctxt ( ) . build ( ) ; 
11931193            infcx. predicate_must_hold_modulo_regions ( & obligation) 
11941194        } ) 
@@ -1362,7 +1362,7 @@ impl<'tcx> TyPosition<'tcx> {
13621362    fn  position_for_result ( self ,  cx :  & LateContext < ' tcx > )  -> Position  { 
13631363        match  ( self . position ,  self . ty )  { 
13641364            ( Position :: ReborrowStable ( precedence) ,  Some ( ty) )  => { 
1365-                 Position :: DerefStable ( precedence,  ty. is_sized ( cx. tcx . at ( DUMMY_SP ) ,  cx. param_env ) ) 
1365+                 Position :: DerefStable ( precedence,  ty. is_sized ( cx. tcx ,  cx. param_env ) ) 
13661366            } , 
13671367            ( position,  _)  => position, 
13681368        } 
@@ -1412,11 +1412,9 @@ fn ty_auto_deref_stability<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'tcx>, precedenc
14121412            | ty:: Closure ( ..) 
14131413            | ty:: Never 
14141414            | ty:: Tuple ( _) 
1415-             | ty:: Projection ( _)  => Position :: DerefStable ( 
1416-                 precedence, 
1417-                 ty. is_sized ( cx. tcx . at ( DUMMY_SP ) ,  cx. param_env . without_caller_bounds ( ) ) , 
1418-             ) 
1419-             . into ( ) , 
1415+             | ty:: Projection ( _)  => { 
1416+                 Position :: DerefStable ( precedence,  ty. is_sized ( cx. tcx ,  cx. param_env . without_caller_bounds ( ) ) ) . into ( ) 
1417+             } , 
14201418        } ; 
14211419    } 
14221420} 
0 commit comments