@@ -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 ;
@@ -1045,7 +1044,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
10451044 let source = self . resolve_vars_with_obligations ( expr_ty) ;
10461045 debug ! ( "coercion::can_with_predicates({:?} -> {:?})" , source, target) ;
10471046
1048- let cause = self . cause ( rustc_span :: DUMMY_SP , ObligationCauseCode :: ExprAssignable ) ;
1047+ let cause = self . cause ( DUMMY_SP , ObligationCauseCode :: ExprAssignable ) ;
10491048 // We don't ever need two-phase here since we throw out the result of the coercion
10501049 let coerce = Coerce :: new ( self , cause, AllowTwoPhase :: No ) ;
10511050 self . probe ( |_| {
@@ -1062,11 +1061,11 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
10621061 /// how many dereference steps needed to achieve `expr_ty <: target`. If
10631062 /// it's not possible, return `None`.
10641063 pub fn deref_steps ( & self , expr_ty : Ty < ' tcx > , target : Ty < ' tcx > ) -> Option < usize > {
1065- let cause = self . cause ( rustc_span :: DUMMY_SP , ObligationCauseCode :: ExprAssignable ) ;
1064+ let cause = self . cause ( DUMMY_SP , ObligationCauseCode :: ExprAssignable ) ;
10661065 // We don't ever need two-phase here since we throw out the result of the coercion
10671066 let coerce = Coerce :: new ( self , cause, AllowTwoPhase :: No ) ;
10681067 coerce
1069- . autoderef ( rustc_span :: DUMMY_SP , expr_ty)
1068+ . autoderef ( DUMMY_SP , expr_ty)
10701069 . find_map ( |( ty, steps) | self . probe ( |_| coerce. unify ( ty, target) ) . ok ( ) . map ( |_| steps) )
10711070 }
10721071
@@ -1077,7 +1076,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
10771076 /// trait or region sub-obligations. (presumably we could, but it's not
10781077 /// particularly important for diagnostics...)
10791078 pub fn deref_once_mutably_for_diagnostic ( & self , expr_ty : Ty < ' tcx > ) -> Option < Ty < ' tcx > > {
1080- self . autoderef ( rustc_span :: DUMMY_SP , expr_ty) . nth ( 1 ) . and_then ( |( deref_ty, _) | {
1079+ self . autoderef ( DUMMY_SP , expr_ty) . nth ( 1 ) . and_then ( |( deref_ty, _) | {
10811080 self . infcx
10821081 . type_implements_trait (
10831082 self . tcx . lang_items ( ) . deref_mut_trait ( ) ?,
0 commit comments