Skip to content

Commit 8ac80a9

Browse files
Suppress suggestions in derive macro
1 parent f6ee4bf commit 8ac80a9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

compiler/rustc_hir_typeck/src/fn_ctxt/suggestions.rs

+5
Original file line numberDiff line numberDiff line change
@@ -2692,6 +2692,11 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
26922692
return false;
26932693
}
26942694

2695+
if expr.span.in_derive_expansion() {
2696+
// Ignore if span is from derive macro.
2697+
return false;
2698+
}
2699+
26952700
let Ok(src) = self.tcx.sess.source_map().span_to_snippet(expr.span) else {
26962701
return false;
26972702
};

0 commit comments

Comments
 (0)