diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2022-12-11 14:49:50 -0800 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2022-12-11 14:49:50 -0800 |
| commit | 2838b8e515d139245fba71895277fab26082d522 (patch) | |
| tree | 7d58d6aa4239dfd753ee4f3541b58f5c03799606 /compiler/rustc_errors | |
| parent | ce486d538b909658f72d6016dae758f075089d3c (diff) | |
| download | rust-2838b8e515d139245fba71895277fab26082d522.tar.gz rust-2838b8e515d139245fba71895277fab26082d522.zip | |
Point at method call when it is the source of the bound error
Diffstat (limited to 'compiler/rustc_errors')
| -rw-r--r-- | compiler/rustc_errors/src/diagnostic.rs | 6 |
1 files changed, 5 insertions, 1 deletions
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 |
