diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2023-01-14 18:45:27 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-01-14 18:45:27 +0100 |
| commit | f04f97cea4823aec0f412007a0c068fbccc37596 (patch) | |
| tree | 4e364895ba44c6a470e0bacfdb9ff91ce5a41306 /compiler/rustc_trait_selection/src | |
| parent | 43134714f529d087aecb8c6327ca282c2fa261f1 (diff) | |
| parent | 6821adb65145463ffe51e044cbe37ea823059222 (diff) | |
| download | rust-f04f97cea4823aec0f412007a0c068fbccc37596.tar.gz rust-f04f97cea4823aec0f412007a0c068fbccc37596.zip | |
Rollup merge of #106820 - m-ou-se:macro-type-error-thing, r=estebank
Deprioritize fulfillment errors that come from expansions. Fixes (part of?) #69455
Diffstat (limited to 'compiler/rustc_trait_selection/src')
| -rw-r--r-- | compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs b/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs index 41a64a844ce..9fcf02e8dc0 100644 --- a/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs +++ b/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs @@ -454,9 +454,11 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> { } } - for (error, suppressed) in iter::zip(errors, is_suppressed) { - if !suppressed { - self.report_fulfillment_error(error, body_id); + for from_expansion in [false, true] { + for (error, suppressed) in iter::zip(errors, &is_suppressed) { + if !suppressed && error.obligation.cause.span.from_expansion() == from_expansion { + self.report_fulfillment_error(error, body_id); + } } } |
