@@ -30,7 +30,7 @@ use rustc_middle::ty::{
30
30
} ;
31
31
use rustc_semver:: RustcVersion ;
32
32
use 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 } ;
34
34
use rustc_trait_selection:: infer:: InferCtxtExt as _;
35
35
use rustc_trait_selection:: traits:: { query:: evaluate_obligation:: InferCtxtExt as _, Obligation , ObligationCause } ;
36
36
use std:: collections:: VecDeque ;
@@ -714,47 +714,47 @@ fn walk_parents<'tcx>(
714
714
} ,
715
715
Node :: Item ( & Item {
716
716
kind : ItemKind :: Static ( ..) | ItemKind :: Const ( ..) ,
717
- def_id ,
717
+ owner_id ,
718
718
span,
719
719
..
720
720
} )
721
721
| Node :: TraitItem ( & TraitItem {
722
722
kind : TraitItemKind :: Const ( ..) ,
723
- def_id ,
723
+ owner_id ,
724
724
span,
725
725
..
726
726
} )
727
727
| Node :: ImplItem ( & ImplItem {
728
728
kind : ImplItemKind :: Const ( ..) ,
729
- def_id ,
729
+ owner_id ,
730
730
span,
731
731
..
732
732
} ) 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 ) ;
734
734
Some ( ty_auto_deref_stability ( cx, ty, precedence) . position_for_result ( cx) )
735
735
} ,
736
736
737
737
Node :: Item ( & Item {
738
738
kind : ItemKind :: Fn ( ..) ,
739
- def_id ,
739
+ owner_id ,
740
740
span,
741
741
..
742
742
} )
743
743
| Node :: TraitItem ( & TraitItem {
744
744
kind : TraitItemKind :: Fn ( ..) ,
745
- def_id ,
745
+ owner_id ,
746
746
span,
747
747
..
748
748
} )
749
749
| Node :: ImplItem ( & ImplItem {
750
750
kind : ImplItemKind :: Fn ( ..) ,
751
- def_id ,
751
+ owner_id ,
752
752
span,
753
753
..
754
754
} ) if span. ctxt ( ) == ctxt => {
755
755
let output = cx
756
756
. 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 ( ) ) ;
758
758
Some ( ty_auto_deref_stability ( cx, output, precedence) . position_for_result ( cx) )
759
759
} ,
760
760
@@ -1000,7 +1000,7 @@ fn binding_ty_auto_deref_stability<'tcx>(
1000
1000
cx. typeck_results ( ) . node_type ( ty. ty . hir_id ) ,
1001
1001
binder_args,
1002
1002
) )
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 ( ) ) ,
1004
1004
)
1005
1005
}
1006
1006
} ,
@@ -1015,7 +1015,7 @@ fn binding_ty_auto_deref_stability<'tcx>(
1015
1015
cx. typeck_results ( ) . node_type ( ty. ty . hir_id ) ,
1016
1016
binder_args,
1017
1017
) )
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 ( ) ) ,
1019
1019
) ,
1020
1020
TyKind :: OpaqueDef ( ..) | TyKind :: Infer | TyKind :: Typeof ( ..) | TyKind :: TraitObject ( ..) | TyKind :: Err => {
1021
1021
Position :: ReborrowStable ( precedence)
@@ -1116,7 +1116,7 @@ fn needless_borrow_impl_arg_position<'tcx>(
1116
1116
. iter ( )
1117
1117
. filter_map ( |predicate| {
1118
1118
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 )
1120
1120
{
1121
1121
Some ( trait_predicate. trait_ref . def_id )
1122
1122
} else {
@@ -1188,7 +1188,7 @@ fn needless_borrow_impl_arg_position<'tcx>(
1188
1188
}
1189
1189
1190
1190
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) ;
1192
1192
let infcx = cx. tcx . infer_ctxt ( ) . build ( ) ;
1193
1193
infcx. predicate_must_hold_modulo_regions ( & obligation)
1194
1194
} )
@@ -1362,7 +1362,7 @@ impl<'tcx> TyPosition<'tcx> {
1362
1362
fn position_for_result ( self , cx : & LateContext < ' tcx > ) -> Position {
1363
1363
match ( self . position , self . ty ) {
1364
1364
( 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 ) )
1366
1366
} ,
1367
1367
( position, _) => position,
1368
1368
}
@@ -1412,11 +1412,9 @@ fn ty_auto_deref_stability<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'tcx>, precedenc
1412
1412
| ty:: Closure ( ..)
1413
1413
| ty:: Never
1414
1414
| 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
+ } ,
1420
1418
} ;
1421
1419
}
1422
1420
}
0 commit comments