@@ -58,7 +58,7 @@ use rustc_middle::ty::visit::TypeVisitableExt;
58
58
use rustc_middle:: ty:: { self , GenericArgsRef , Ty , TyCtxt , TypeAndMut } ;
59
59
use rustc_session:: parse:: feature_err;
60
60
use rustc_span:: symbol:: sym;
61
- use rustc_span:: DesugaringKind ;
61
+ use rustc_span:: { DesugaringKind , DUMMY_SP } ;
62
62
use rustc_target:: spec:: abi:: Abi ;
63
63
use rustc_trait_selection:: infer:: InferCtxtExt as _;
64
64
use rustc_trait_selection:: traits:: error_reporting:: TypeErrCtxtExt as _;
@@ -1054,7 +1054,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
1054
1054
let source = self . resolve_vars_with_obligations ( expr_ty) ;
1055
1055
debug ! ( "coercion::can_with_predicates({:?} -> {:?})" , source, target) ;
1056
1056
1057
- let cause = self . cause ( rustc_span :: DUMMY_SP , ObligationCauseCode :: ExprAssignable ) ;
1057
+ let cause = self . cause ( DUMMY_SP , ObligationCauseCode :: ExprAssignable ) ;
1058
1058
// We don't ever need two-phase here since we throw out the result of the coercion
1059
1059
let coerce = Coerce :: new ( self , cause, AllowTwoPhase :: No ) ;
1060
1060
self . probe ( |_| {
@@ -1071,11 +1071,11 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
1071
1071
/// how many dereference steps needed to achieve `expr_ty <: target`. If
1072
1072
/// it's not possible, return `None`.
1073
1073
pub fn deref_steps ( & self , expr_ty : Ty < ' tcx > , target : Ty < ' tcx > ) -> Option < usize > {
1074
- let cause = self . cause ( rustc_span :: DUMMY_SP , ObligationCauseCode :: ExprAssignable ) ;
1074
+ let cause = self . cause ( DUMMY_SP , ObligationCauseCode :: ExprAssignable ) ;
1075
1075
// We don't ever need two-phase here since we throw out the result of the coercion
1076
1076
let coerce = Coerce :: new ( self , cause, AllowTwoPhase :: No ) ;
1077
1077
coerce
1078
- . autoderef ( rustc_span :: DUMMY_SP , expr_ty)
1078
+ . autoderef ( DUMMY_SP , expr_ty)
1079
1079
. find_map ( |( ty, steps) | self . probe ( |_| coerce. unify ( ty, target) ) . ok ( ) . map ( |_| steps) )
1080
1080
}
1081
1081
@@ -1086,7 +1086,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
1086
1086
/// trait or region sub-obligations. (presumably we could, but it's not
1087
1087
/// particularly important for diagnostics...)
1088
1088
pub fn deref_once_mutably_for_diagnostic ( & self , expr_ty : Ty < ' tcx > ) -> Option < Ty < ' tcx > > {
1089
- self . autoderef ( rustc_span :: DUMMY_SP , expr_ty) . nth ( 1 ) . and_then ( |( deref_ty, _) | {
1089
+ self . autoderef ( DUMMY_SP , expr_ty) . nth ( 1 ) . and_then ( |( deref_ty, _) | {
1090
1090
self . infcx
1091
1091
. type_implements_trait (
1092
1092
self . tcx . lang_items ( ) . deref_mut_trait ( ) ?,
0 commit comments