diff options
| author | bors <bors@rust-lang.org> | 2024-02-12 13:38:31 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-02-12 13:38:31 +0000 |
| commit | d2e446d39e2390093042a7fd8676cc85f2b573d7 (patch) | |
| tree | 2ded1e3a7beab4afadc95bb8cc2f88102effca4c /compiler/rustc_errors | |
| parent | cad872a70cb80b429d2eee8085d62310dec339ba (diff) | |
| parent | 781190f5b7bf0e8bd462dd5b7f5eba574a06fa08 (diff) | |
| download | rust-d2e446d39e2390093042a7fd8676cc85f2b573d7.tar.gz rust-d2e446d39e2390093042a7fd8676cc85f2b573d7.zip | |
Auto merge of #3296 - RalfJung:rustup, r=RalfJung
Rustup, more pthread tests
Diffstat (limited to 'compiler/rustc_errors')
| -rw-r--r-- | compiler/rustc_errors/src/diagnostic.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/compiler/rustc_errors/src/diagnostic.rs b/compiler/rustc_errors/src/diagnostic.rs index 03717a4d654..2deb18484ec 100644 --- a/compiler/rustc_errors/src/diagnostic.rs +++ b/compiler/rustc_errors/src/diagnostic.rs @@ -516,6 +516,17 @@ impl Diagnostic { /// Helper for pushing to `self.suggestions`, if available (not disable). fn push_suggestion(&mut self, suggestion: CodeSuggestion) { + for subst in &suggestion.substitutions { + for part in &subst.parts { + let span = part.span; + let call_site = span.ctxt().outer_expn_data().call_site; + if span.in_derive_expansion() && span.overlaps_or_adjacent(call_site) { + // Ignore if spans is from derive macro. + return; + } + } + } + if let Ok(suggestions) = &mut self.suggestions { suggestions.push(suggestion); } |
