@@ -755,9 +755,9 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
755755 expected_ret : Expectation < ' tcx > ,
756756 formal_ret : Ty < ' tcx > ,
757757 formal_args : & [ Ty < ' tcx > ] ,
758- ) -> Option < Vec < Ty < ' tcx > > > {
758+ ) -> Vec < Ty < ' tcx > > {
759759 let formal_ret = self . resolve_vars_with_obligations ( formal_ret) ;
760- let ret_ty = expected_ret. only_has_type ( self ) ? ;
760+ let Some ( ret_ty) = expected_ret. only_has_type ( self ) else { return vec ! [ ] ; } ;
761761
762762 // HACK(oli-obk): This is a hack to keep RPIT and TAIT in sync wrt their behaviour.
763763 // Without it, the inference
@@ -779,7 +779,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
779779 if let ty:: subst:: GenericArgKind :: Type ( ty) = ty. unpack ( ) {
780780 if let ty:: Opaque ( def_id, _) = * ty. kind ( ) {
781781 if self . infcx . opaque_type_origin ( def_id, DUMMY_SP ) . is_some ( ) {
782- return None ;
782+ return vec ! [ ] ;
783783 }
784784 }
785785 }
@@ -820,7 +820,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
820820
821821 // Record all the argument types, with the substitutions
822822 // produced from the above subtyping unification.
823- Ok ( Some ( formal_args. iter ( ) . map ( |& ty| self . resolve_vars_if_possible ( ty) ) . collect ( ) ) )
823+ Ok ( formal_args. iter ( ) . map ( |& ty| self . resolve_vars_if_possible ( ty) ) . collect ( ) )
824824 } )
825825 . unwrap_or_default ( ) ;
826826 debug ! ( ?formal_args, ?formal_ret, ?expect_args, ?expected_ret) ;
0 commit comments