From 2838b8e515d139245fba71895277fab26082d522 Mon Sep 17 00:00:00 2001 From: Esteban Küber Date: Sun, 11 Dec 2022 14:49:50 -0800 Subject: Point at method call when it is the source of the bound error --- compiler/rustc_errors/src/diagnostic.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'compiler/rustc_errors/src') diff --git a/compiler/rustc_errors/src/diagnostic.rs b/compiler/rustc_errors/src/diagnostic.rs index 06bb5edc090..6bc0c261565 100644 --- a/compiler/rustc_errors/src/diagnostic.rs +++ b/compiler/rustc_errors/src/diagnostic.rs @@ -370,7 +370,11 @@ impl Diagnostic { self.set_span(after); for span_label in before.span_labels() { if let Some(label) = span_label.label { - self.span.push_span_label(after, label); + if span_label.is_primary { + self.span.push_span_label(after, label); + } else { + self.span.push_span_label(span_label.span, label); + } } } self -- cgit 1.4.1-3-g733a5