@@ -44,7 +44,7 @@ use rustc_hir as hir;
4444use rustc_hir:: def_id:: { DefId , LocalDefId } ;
4545use rustc_hir_analysis:: hir_ty_lowering:: HirTyLowerer ;
4646use rustc_infer:: infer:: relate:: RelateResult ;
47- use rustc_infer:: infer:: { Coercion , DefineOpaqueTypes , InferOk , InferResult } ;
47+ use rustc_infer:: infer:: { DefineOpaqueTypes , InferOk , InferResult , RegionVariableOrigin } ;
4848use rustc_infer:: traits:: {
4949 IfExpressionCause , MatchExpressionArmCause , Obligation , PredicateObligation ,
5050 PredicateObligations , SelectionError ,
@@ -431,7 +431,7 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
431431 } else {
432432 if r_borrow_var. is_none ( ) {
433433 // create var lazily, at most once
434- let coercion = Coercion ( span) ;
434+ let coercion = RegionVariableOrigin :: Coercion ( span) ;
435435 let r = self . next_region_var ( coercion) ;
436436 r_borrow_var = Some ( r) ; // [4] above
437437 }
@@ -549,7 +549,7 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
549549 ( & ty:: Ref ( _, ty_a, mutbl_a) , & ty:: Ref ( _, _, mutbl_b) ) => {
550550 coerce_mutbls ( mutbl_a, mutbl_b) ?;
551551
552- let coercion = Coercion ( self . cause . span ) ;
552+ let coercion = RegionVariableOrigin :: Coercion ( self . cause . span ) ;
553553 let r_borrow = self . next_region_var ( coercion) ;
554554
555555 // We don't allow two-phase borrows here, at least for initial
@@ -672,7 +672,7 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
672672 return Err ( TypeError :: Mismatch ) ;
673673 }
674674 }
675- Err ( traits :: Unimplemented ) => {
675+ Err ( SelectionError :: Unimplemented ) => {
676676 debug ! ( "coerce_unsized: early return - can't prove obligation" ) ;
677677 return Err ( TypeError :: Mismatch ) ;
678678 }
0 commit comments