-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect span / broken rustfix: help: use dyn
: dyn #[dom_struct]
#61963
Comments
Triage: Preliminarily assigning P-high before Felix reviews this. |
Also cc @pnkfelix since iirc you did some macro related work here. |
Possible solution: when a warning’s span is exactly a macro invocation, don’t emit a “suggested fix” that is likely wrong. (But still emit a warning.) |
We have that check for most suggestions, but it might be missing for |
This is in rustc 1.37.0-nightly (04a3dd8 2019-06-18).
|
There are many of them, and rustfix is broken: rust-lang/rust#61963
Oh. I just noticed the |
Apologies for the time this has taken - I've struggled to find time to dig in to this. So far, I've managed to make a smaller example (it still depends on |
Thanks to some help from @lqd, I've now got a minimal test case w/out any dependencies that outputs the same tokens that the reduced example from servo did (you can see it in 732507b). When inspecting the span that the lint is emitted for, it isn't marked as coming from a macro expansion, and it appears that it was created that way during the macro expansion. I'd appreciate any opinions on what the correct fix is here - is it a bug in |
This commit adds a reproduction of the error reported in servo which demonstrates the current, incorrect behaviour. Co-authored-by: Rémy Rakić <remy.rakic@gmail.com>
I believe this is a compiler bug, not something that needs a fix in syn or quote. #0 is a call_site span. It is the span of tokens in macro output that are not attributable to any particular input token. Usually that will be most of the tokens in any macro output; diagnostics need to take this into account. |
…gestion, r=estebank Stop bare trait lint applying to macro call sites Fixes rust-lang#61963. Apologies for the delay with in fixing this. If anyone has a better idea how to detect this macro call site case, I'd be happy to fix this in a more robust, less hacky way. r? @estebank
…gestion, r=estebank Stop bare trait lint applying to macro call sites Fixes rust-lang#61963. Apologies for the delay with in fixing this. If anyone has a better idea how to detect this macro call site case, I'd be happy to fix this in a more robust, less hacky way. r? @estebank
…gestion, r=estebank Stop bare trait lint applying to macro call sites Fixes rust-lang#61963. Apologies for the delay with in fixing this. If anyone has a better idea how to detect this macro call site case, I'd be happy to fix this in a more robust, less hacky way. r? @estebank
…gestion, r=estebank Stop bare trait lint applying to macro call sites Fixes rust-lang#61963. Apologies for the delay with in fixing this. If anyone has a better idea how to detect this macro call site case, I'd be happy to fix this in a more robust, less hacky way. r? @estebank
One of the many new (or newly enabled by default) warnings in Servo in today’s Nightly:
The suggestion is wrong, which means
cargo fix
also fails and therefore does not apply fixes for (the many) other warnings where the suggestion is correct.The text was updated successfully, but these errors were encountered: