diff options
| author | long-long-float <niinikazuki@yahoo.co.jp> | 2023-12-13 01:43:10 +0900 |
|---|---|---|
| committer | long-long-float <niinikazuki@yahoo.co.jp> | 2024-02-06 00:32:19 +0900 |
| commit | 87ea0d76fe1ae997a11fbc914daf33644d5c65bf (patch) | |
| tree | 20b7935cbeda244570c8be307ccef33cf6d06ed3 | |
| parent | 8c0b4f67c9b4bf477df38c16669fd576d46a2b3d (diff) | |
| download | rust-87ea0d76fe1ae997a11fbc914daf33644d5c65bf.tar.gz rust-87ea0d76fe1ae997a11fbc914daf33644d5c65bf.zip | |
Suppress suggestions in derive macro
| -rw-r--r-- | compiler/rustc_hir_typeck/src/fn_ctxt/suggestions.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/rustc_hir_typeck/src/fn_ctxt/suggestions.rs b/compiler/rustc_hir_typeck/src/fn_ctxt/suggestions.rs index 5395ffda1d1..aeab3629ece 100644 --- a/compiler/rustc_hir_typeck/src/fn_ctxt/suggestions.rs +++ b/compiler/rustc_hir_typeck/src/fn_ctxt/suggestions.rs @@ -2698,6 +2698,11 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { return false; } + if expr.span.in_derive_expansion() { + // Ignore if span is from derive macro. + return false; + } + let Ok(src) = self.tcx.sess.source_map().span_to_snippet(expr.span) else { return false; }; |
