@@ -755,9 +755,9 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
755
755
expected_ret : Expectation < ' tcx > ,
756
756
formal_ret : Ty < ' tcx > ,
757
757
formal_args : & [ Ty < ' tcx > ] ,
758
- ) -> Option < Vec < Ty < ' tcx > > > {
758
+ ) -> Vec < Ty < ' tcx > > {
759
759
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 ! [ ] ; } ;
761
761
762
762
// HACK(oli-obk): This is a hack to keep RPIT and TAIT in sync wrt their behaviour.
763
763
// Without it, the inference
@@ -779,7 +779,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
779
779
if let ty:: subst:: GenericArgKind :: Type ( ty) = ty. unpack ( ) {
780
780
if let ty:: Opaque ( def_id, _) = * ty. kind ( ) {
781
781
if self . infcx . opaque_type_origin ( def_id, DUMMY_SP ) . is_some ( ) {
782
- return None ;
782
+ return vec ! [ ] ;
783
783
}
784
784
}
785
785
}
@@ -820,7 +820,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
820
820
821
821
// Record all the argument types, with the substitutions
822
822
// 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 ( ) )
824
824
} )
825
825
. unwrap_or_default ( ) ;
826
826
debug ! ( ?formal_args, ?formal_ret, ?expect_args, ?expected_ret) ;
0 commit comments