Suppress suggestions in derive macro

This commit is contained in:
long-long-float 2023-12-13 01:43:10 +09:00
parent 8c0b4f67c9
commit 87ea0d76fe

View File

@ -2698,6 +2698,11 @@ pub(crate) fn suggest_cast(
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;
};