Enhance error reporting for write!/writeln! macros by reez12g · Pull Request #139371 · rust-lang/rust (original) (raw)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't fix the issue imo. This PR just causes a bunch of dead code further down that happens to include the diagnostic that points to the body of the macro. Also, the call to

self.suggest_missing_writer(rcvr_ty, rcvr_expr)

is now unreachable - that's a really helpful error message that shouldn't be disabled.

I think the problem is elsewhere, and the method that recommend similar names (or the caller(s) of it) isn't checking whether it's in a (foreign) macro expansion.