about summary refs log tree commit diff
path: root/src/libsyntax/errors
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-12-09 00:41:26 +0000
committerbors <bors@rust-lang.org>2015-12-09 00:41:26 +0000
commit462ec057649e11ce1967b0eea6c0353375c160ea (patch)
treef3652b6a07d899e0f054fc1b5e0f384c5fca1a9e /src/libsyntax/errors
parent37b35e962ae5390a339146a57527c399fa7f88c6 (diff)
parentc1d3164700e76323e30cdf5c84af50c2ca46ff75 (diff)
downloadrust-462ec057649e11ce1967b0eea6c0353375c160ea.tar.gz
rust-462ec057649e11ce1967b0eea6c0353375c160ea.zip
Auto merge of #30145 - petrochenkov:hyg, r=nrc
Instead of `ast::Ident`, bindings, paths and labels in HIR now keep a new structure called `hir::Ident` containing mtwt-renamed `name` and the original not-renamed `unhygienic_name`. `name` is supposed to be used by default, `unhygienic_name` is rarely used.

This is not ideal, but better than the status quo for two reasons:
- MTWT tables can be cleared immediately after lowering to HIR
- This is less bug-prone, because it is impossible now to forget applying `mtwt::resolve` to a name. It is still possible to use `name` instead of `unhygienic_name` by mistake, but `unhygienic_name`s are used only in few very special circumstances, so it shouldn't be a problem.

Besides name resolution `unhygienic_name` is used in some lints and debuginfo. `unhygienic_name` can be very well approximated by "reverse renaming" `token::intern(name.as_str())` or even plain string `name.as_str()`, except that it would break gensyms like `iter` in desugared `for` loops. This approximation is likely good enough for lints and debuginfo, but not for name resolution, unfortunately (see https://github.com/rust-lang/rust/issues/27639), so `unhygienic_name` has to be kept.

cc https://github.com/rust-lang/rust/issues/29782

r? @nrc
Diffstat (limited to 'src/libsyntax/errors')
0 files changed, 0 insertions, 0 deletions