Skip to content

Commit 8d48597

Browse files
committed
Point at return type obligations instead of at fn ident
1 parent 972ae5a commit 8d48597

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/librustc_typeck/check/wfcheck.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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

src/test/ui/type-alias-impl-trait/generic_duplicate_lifetime_param.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
error: non-defining opaque type use in defining scope
2-
--> $DIR/generic_duplicate_lifetime_param.rs:7:4
2+
--> $DIR/generic_duplicate_lifetime_param.rs:7:26
33
|
44
LL | fn one<'a>(t: &'a ()) -> Two<'a, 'a> {
5-
| ^^^
5+
| ^^^^^^^^^^^
66
|
77
note: lifetime used multiple times
88
--> $DIR/generic_duplicate_lifetime_param.rs:5:10

0 commit comments

Comments
 (0)