@@ -59,8 +59,7 @@ use rustc_middle::ty::visit::TypeVisitableExt;
5959use rustc_middle:: ty:: { self , GenericArgsRef , Ty , TyCtxt } ;
6060use rustc_session:: parse:: feature_err;
6161use rustc_span:: symbol:: sym;
62- use rustc_span:: DesugaringKind ;
63- use rustc_span:: { BytePos , Span } ;
62+ use rustc_span:: { BytePos , DesugaringKind , Span , DUMMY_SP } ;
6463use rustc_target:: spec:: abi:: Abi ;
6564use rustc_trait_selection:: infer:: InferCtxtExt as _;
6665use rustc_trait_selection:: traits:: error_reporting:: suggestions:: TypeErrCtxtExt ;
@@ -1051,7 +1050,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
10511050 let source = self . resolve_vars_with_obligations ( expr_ty) ;
10521051 debug ! ( "coercion::can_with_predicates({:?} -> {:?})" , source, target) ;
10531052
1054- let cause = self . cause ( rustc_span :: DUMMY_SP , ObligationCauseCode :: ExprAssignable ) ;
1053+ let cause = self . cause ( DUMMY_SP , ObligationCauseCode :: ExprAssignable ) ;
10551054 // We don't ever need two-phase here since we throw out the result of the coercion
10561055 let coerce = Coerce :: new ( self , cause, AllowTwoPhase :: No ) ;
10571056 self . probe ( |_| {
@@ -1068,11 +1067,11 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
10681067 /// how many dereference steps needed to achieve `expr_ty <: target`. If
10691068 /// it's not possible, return `None`.
10701069 pub fn deref_steps ( & self , expr_ty : Ty < ' tcx > , target : Ty < ' tcx > ) -> Option < usize > {
1071- let cause = self . cause ( rustc_span :: DUMMY_SP , ObligationCauseCode :: ExprAssignable ) ;
1070+ let cause = self . cause ( DUMMY_SP , ObligationCauseCode :: ExprAssignable ) ;
10721071 // We don't ever need two-phase here since we throw out the result of the coercion
10731072 let coerce = Coerce :: new ( self , cause, AllowTwoPhase :: No ) ;
10741073 coerce
1075- . autoderef ( rustc_span :: DUMMY_SP , expr_ty)
1074+ . autoderef ( DUMMY_SP , expr_ty)
10761075 . find_map ( |( ty, steps) | self . probe ( |_| coerce. unify ( ty, target) ) . ok ( ) . map ( |_| steps) )
10771076 }
10781077
@@ -1083,7 +1082,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
10831082 /// trait or region sub-obligations. (presumably we could, but it's not
10841083 /// particularly important for diagnostics...)
10851084 pub fn deref_once_mutably_for_diagnostic ( & self , expr_ty : Ty < ' tcx > ) -> Option < Ty < ' tcx > > {
1086- self . autoderef ( rustc_span :: DUMMY_SP , expr_ty) . nth ( 1 ) . and_then ( |( deref_ty, _) | {
1085+ self . autoderef ( DUMMY_SP , expr_ty) . nth ( 1 ) . and_then ( |( deref_ty, _) | {
10871086 self . infcx
10881087 . type_implements_trait (
10891088 self . tcx . lang_items ( ) . deref_mut_trait ( ) ?,
0 commit comments