@@ -59,8 +59,7 @@ use rustc_middle::ty::visit::TypeVisitableExt;
59
59
use rustc_middle:: ty:: { self , GenericArgsRef , Ty , TyCtxt } ;
60
60
use rustc_session:: parse:: feature_err;
61
61
use rustc_span:: symbol:: sym;
62
- use rustc_span:: DesugaringKind ;
63
- use rustc_span:: { BytePos , Span } ;
62
+ use rustc_span:: { BytePos , DesugaringKind , Span , DUMMY_SP } ;
64
63
use rustc_target:: spec:: abi:: Abi ;
65
64
use rustc_trait_selection:: infer:: InferCtxtExt as _;
66
65
use rustc_trait_selection:: traits:: error_reporting:: suggestions:: TypeErrCtxtExt ;
@@ -1045,7 +1044,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
1045
1044
let source = self . resolve_vars_with_obligations ( expr_ty) ;
1046
1045
debug ! ( "coercion::can_with_predicates({:?} -> {:?})" , source, target) ;
1047
1046
1048
- let cause = self . cause ( rustc_span :: DUMMY_SP , ObligationCauseCode :: ExprAssignable ) ;
1047
+ let cause = self . cause ( DUMMY_SP , ObligationCauseCode :: ExprAssignable ) ;
1049
1048
// We don't ever need two-phase here since we throw out the result of the coercion
1050
1049
let coerce = Coerce :: new ( self , cause, AllowTwoPhase :: No ) ;
1051
1050
self . probe ( |_| {
@@ -1062,11 +1061,11 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
1062
1061
/// how many dereference steps needed to achieve `expr_ty <: target`. If
1063
1062
/// it's not possible, return `None`.
1064
1063
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 ) ;
1066
1065
// We don't ever need two-phase here since we throw out the result of the coercion
1067
1066
let coerce = Coerce :: new ( self , cause, AllowTwoPhase :: No ) ;
1068
1067
coerce
1069
- . autoderef ( rustc_span :: DUMMY_SP , expr_ty)
1068
+ . autoderef ( DUMMY_SP , expr_ty)
1070
1069
. find_map ( |( ty, steps) | self . probe ( |_| coerce. unify ( ty, target) ) . ok ( ) . map ( |_| steps) )
1071
1070
}
1072
1071
@@ -1077,7 +1076,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
1077
1076
/// trait or region sub-obligations. (presumably we could, but it's not
1078
1077
/// particularly important for diagnostics...)
1079
1078
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, _) | {
1081
1080
self . infcx
1082
1081
. type_implements_trait (
1083
1082
self . tcx . lang_items ( ) . deref_mut_trait ( ) ?,
0 commit comments