Skip to content

Commit

Permalink
Suppress suggestions in derive macro
Browse files Browse the repository at this point in the history
  • Loading branch information
long-long-float committed Jan 24, 2024
1 parent f6ee4bf commit 8ac80a9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions compiler/rustc_hir_typeck/src/fn_ctxt/suggestions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2692,6 +2692,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;
};
Expand Down

0 comments on commit 8ac80a9

Please sign in to comment.