@@ -530,7 +530,7 @@ fn check_where_clauses<'tcx, 'fcx>(
530530 fcx : & FnCtxt < ' fcx , ' tcx > ,
531531 span : Span ,
532532 def_id : DefId ,
533- return_ty : Option < Ty < ' tcx > > ,
533+ return_ty : Option < ( Ty < ' tcx > , Span ) > ,
534534) {
535535 debug ! ( "check_where_clauses(def_id={:?}, return_ty={:?})" , def_id, return_ty) ;
536536
@@ -664,7 +664,7 @@ fn check_where_clauses<'tcx, 'fcx>(
664664
665665 let mut predicates = predicates. instantiate_identity ( fcx. tcx ) ;
666666
667- if let Some ( return_ty) = return_ty {
667+ if let Some ( ( return_ty, span ) ) = return_ty {
668668 predicates. predicates . extend ( check_opaque_types ( tcx, fcx, def_id, span, return_ty) ) ;
669669 }
670670
@@ -708,7 +708,7 @@ fn check_fn_or_method<'fcx, 'tcx>(
708708 // FIXME(#25759) return types should not be implied bounds
709709 implied_bounds. push ( sig. output ( ) ) ;
710710
711- check_where_clauses ( tcx, fcx, span, def_id, Some ( sig. output ( ) ) ) ;
711+ check_where_clauses ( tcx, fcx, span, def_id, Some ( ( sig. output ( ) , hir_sig . decl . output . span ( ) ) ) ) ;
712712}
713713
714714/// Checks "defining uses" of opaque `impl Trait` types to ensure that they meet the restrictions
0 commit comments