-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Remove last traces of identifier hygiene from HIR #34207
Conversation
I need to be sure clippy is okay with this change, while the compiler itself doesn't use information removed in this patch anymore, external lints still can use it. |
It looks like we already stopped using unhygenize. Might still break, though. We rely on span expansion info now mostly. |
@Manishearth: We still use unhygienize 😛: $ ag unhygienize
clippy_lints/src/shadow.rs
69: bindings.push((ident.node.unhygienize(), ident.span))
123: let name = ident.node.unhygienize();
330: !path.global && path.segments.len() == 1 && path.segments[0].name.unhygienize() == name
340: if self.name == name.unhygienize() {
clippy_lints/src/misc.rs
414: segment != segment.unhygienize() && // not in bang macro From the comment, the last one looks like it could use |
|
Nice! LGTM. |
That's a good observation, all hygienic things (i.e. bindings, labels and some expression paths) have definitions in def_map, except for some function parameters, so yes, they can be used instead. |
LGTM, I have a working PR for Clippy based on this. |
@bors r+ |
📌 Commit f59afbc has been approved by |
⌛ Testing commit f59afbc with merge 9604420... |
Remove last traces of identifier hygiene from HIR rust-lang@e783a0a removed the [last](rust-lang#33654 (comment)) [use](rust-lang#33654 (comment)) of hygiene at post-resolve compilation stages, so we can avoid renaming during lowering to HIR and just keep original names. r? @nrc
💔 Test failed - auto-mac-64-opt-rustbuild |
e783a0a removed the last use of hygiene at post-resolve compilation stages, so we can avoid renaming during lowering to HIR and just keep original names.
r? @nrc