Open jamesmunns opened 2 months ago
CC https://github.com/jamesmunns/postcard-rpc/issues/34 which is where I ran into this specific problem.
I'm not sure if this is really a bug, as it's probably the correct behavior from a couple of other decisions, but it was surprising to me when I ran into it, and might be an opportunity for diagnostics, and maybe revisiting whether deny
lints should be ignored.
I tried this code:
then:
I expected to see this happen:
I would expect the deny lint to fire and halt compilation
Instead, this happened:
The crate compiles with no warnings or errors
You can see the issue in the expanded code:
Meta
I asked about this in Zulip, and it was mentioned that only a select number of lints still fire during macro expansion.
However:
But more importantly:
If the compiler could potentially know that a lint will never fire, it might be good to add a warning for that at the macro declaration site, something like: