Uh oh!
There was an error while loading. Please reload this page.
Remove hir::Ident - #33654
Conversation
There was a problem hiding this comment.
We don't want to rename constants or unit variants/structs, that can also be represented with PatKind::Ident due to parsing ambiguities, only fresh bindings.
There was a problem hiding this comment.
At this stage we are post-parsing and post-name resolution, so where do the remaining ambiguities get resolved? Put another way, in some sense this renaming must happen somewhere, where does it happen (and how)?
There was a problem hiding this comment.
I'm not sure I understand the question.
At this stage we are post-parsing and post-name resolution, so where do the remaining ambiguities get resolved?
All ambiguities are resolved during name resolution, there's nothing ambiguous at this stage.
Put another way, in some sense this renaming must happen somewhere, where does it happen (and how)?
Renaming is done twice, once during name resolution, its results aren't saved anywhere, and once more during lowering to HIR, its results are persistent and kept in HIR.Names in HIR need to be properly renamed to correctly treat cases like this, which in principle can be interpreted as requiring some rudimentary form of name resolution during type checking.
There was a problem hiding this comment.
If tables of "canonical bindings" were filled during the main name resolution pass and saved for later, then HIR could keep plain non-renamed Names for everything.
bors
commented
May 16, 2016
☔ The latest upstream changes (presumably #33505) made this pull request unmergeable. Please resolve the merge conflicts. |
Do not rename invalid identifiers, they stop being invalid after renaming
petrochenkov
commented
May 16, 2016
Rebased. |
nrc
commented
May 18, 2016
@bors: r+ |
bors
commented
May 18, 2016
📌 Commit 02a1eef has been approved by |
bors
commented
May 18, 2016
bors
commented
May 18, 2016
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
Now when name resolution is done on AST,
hir::Identis no longer necessary.See #30145 for more details.
r? @nrc