Use Idents in a number of structures in HIR

Namely: labels, type parameters, bindings in patterns, parameter names in functions without body.
All of these do not need hygiene after lowering to HIR, only span locations.
This commit is contained in:
Vadim Petrochenkov 2018-06-10 19:33:30 +03:00
parent e8215a4f6f
commit c6ca1e4abd
24 changed files with 125 additions and 156 deletions

View file

@ -7325,7 +7325,7 @@ impl<'a> Parser<'a> {
match self.token {
token::Ident(ident, false) if ident.name == keywords::Underscore.name() => {
self.bump(); // `_`
Ok(Some(Ident::new(ident.name.gensymed(), ident.span)))
Ok(Some(ident.gensym()))
}
_ => self.parse_ident().map(Some),
}