-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Rework #[clippy::dump]
attribute for debugging
#8701
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
Conversation
r? @Manishearth (rust-highfive has picked a reviewer for you, use r? to override) |
cece5d7
to
d99bf09
Compare
This seems okay to me! |
Isn't this what the |
We have a |
This new "lint" is a really trivial implementation, so I wouldn't be opposed to adding it, but we should then figure out what to do with the inspector. I don't think we need both tools? |
The name does sound better! We could just replace the old implementation of |
That sounds good to me. The inspector lint really didn't receive much love in the last few (at least 3-4) years. It is from a time where you couldn't just debug print the HIR and get something sensible. So I would be good with just replacing that implementation with this. If we should find, that resolving things would make sense, we can try to do this in this simpler impl instead of trying to fix legacy code. |
#[clippy::print_hir]
attribute for debugging#[clippy::dump]
attribute for debugging
d99bf09
to
ccedc64
Compare
@bors r+ Thanks! |
📌 Commit ccedc64 has been approved by |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
Hey @rust-lang/clippy, this adds a new
#[clippy::print_hir]
attribute that prints the node to the console using{:#?}
. Personally, I use print debugging quite a lot while working on Clippy, and this is a simple shortcut that also works in the playground (Once this has been synced). The question is now, if we want to have this attribute. Are there any concerns? I think it's similar to our#[clippy::author]
attribute.I haven't added a test, as the
.stdout
file would require updates with every HIR change inside rustc. Here are some examples, for the current implementation`do_something(&map);`
`use std::collections::HashMap;`
`"100"`
changelog: Added
[clippy::print_hir]
to inspect rustc's internal representation