diff options
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_typeck/src/collect/type_of.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler/rustc_typeck/src/collect/type_of.rs b/compiler/rustc_typeck/src/collect/type_of.rs index 4e1edd17194..95d1b6a15f5 100644 --- a/compiler/rustc_typeck/src/collect/type_of.rs +++ b/compiler/rustc_typeck/src/collect/type_of.rs @@ -610,7 +610,11 @@ fn find_opaque_ty_constraints(tcx: TyCtxt<'_>, def_id: LocalDefId) -> Ty<'_> { concrete_type.span, format!("expected `{}`, got `{}`", prev.ty, concrete_type.ty), ); - err.span_note(prev.span, "previous use here"); + if prev.span == concrete_type.span { + err.span_label(prev.span, "this expression supplies two conflicting concrete types for the same opaque type"); + } else { + err.span_note(prev.span, "previous use here"); + } err.emit(); } } else { |
