@@ -44,7 +44,7 @@ use rustc_hir as hir;
44
44
use rustc_hir:: def_id:: { DefId , LocalDefId } ;
45
45
use rustc_hir_analysis:: hir_ty_lowering:: HirTyLowerer ;
46
46
use rustc_infer:: infer:: relate:: RelateResult ;
47
- use rustc_infer:: infer:: { Coercion , DefineOpaqueTypes , InferOk , InferResult } ;
47
+ use rustc_infer:: infer:: { DefineOpaqueTypes , InferOk , InferResult , RegionVariableOrigin } ;
48
48
use rustc_infer:: traits:: {
49
49
IfExpressionCause , MatchExpressionArmCause , Obligation , PredicateObligation ,
50
50
PredicateObligations , SelectionError ,
@@ -431,7 +431,7 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
431
431
} else {
432
432
if r_borrow_var. is_none ( ) {
433
433
// create var lazily, at most once
434
- let coercion = Coercion ( span) ;
434
+ let coercion = RegionVariableOrigin :: Coercion ( span) ;
435
435
let r = self . next_region_var ( coercion) ;
436
436
r_borrow_var = Some ( r) ; // [4] above
437
437
}
@@ -549,7 +549,7 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
549
549
( & ty:: Ref ( _, ty_a, mutbl_a) , & ty:: Ref ( _, _, mutbl_b) ) => {
550
550
coerce_mutbls ( mutbl_a, mutbl_b) ?;
551
551
552
- let coercion = Coercion ( self . cause . span ) ;
552
+ let coercion = RegionVariableOrigin :: Coercion ( self . cause . span ) ;
553
553
let r_borrow = self . next_region_var ( coercion) ;
554
554
555
555
// We don't allow two-phase borrows here, at least for initial
@@ -672,7 +672,7 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
672
672
return Err ( TypeError :: Mismatch ) ;
673
673
}
674
674
}
675
- Err ( traits :: Unimplemented ) => {
675
+ Err ( SelectionError :: Unimplemented ) => {
676
676
debug ! ( "coerce_unsized: early return - can't prove obligation" ) ;
677
677
return Err ( TypeError :: Mismatch ) ;
678
678
}
0 commit comments