From 48816e74930cb8769fea5acb8a706878b4d79d5b Mon Sep 17 00:00:00 2001 From: Esteban Küber Date: Sun, 10 Aug 2025 21:55:02 +0000 Subject: Do not point at macro invocation when providing inference context --- compiler/rustc_trait_selection/src/error_reporting/infer/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'compiler/rustc_trait_selection/src') diff --git a/compiler/rustc_trait_selection/src/error_reporting/infer/mod.rs b/compiler/rustc_trait_selection/src/error_reporting/infer/mod.rs index 1c890821b1d..8551780bcd5 100644 --- a/compiler/rustc_trait_selection/src/error_reporting/infer/mod.rs +++ b/compiler/rustc_trait_selection/src/error_reporting/infer/mod.rs @@ -459,7 +459,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { span, format!("this is an iterator with items of type `{}`", args.type_at(0)), ); - } else { + } else if !span.overlaps(cause.span) { let expected_ty = self.tcx.short_string(expected_ty, err.long_ty_path()); err.span_label(span, format!("this expression has type `{expected_ty}`")); } -- cgit 1.4.1-3-g733a5