]> git.lizzy.rs Git - rust.git/commitdiff
auto merge of #6737 : dotdash/rust/static_keywords, r=pcwalton
authorbors <bors@rust-lang.org>
Sat, 25 May 2013 18:04:58 +0000 (11:04 -0700)
committerbors <bors@rust-lang.org>
Sat, 25 May 2013 18:04:58 +0000 (11:04 -0700)
Currently, keywords are stored in hashsets that are recreated for every
Parser instance, which is quite expensive since macro expansion creates
lots of them. Additionally, the parser functions that look for a keyword
currently accept a string and have a runtime check to validate that they
actually received a keyword.

By creating an enum for the keywords and inserting them into the
ident interner, we can avoid the creation of the hashsets and get static
checks for the keywords.

For libstd, this cuts the parse+expansion part from ~2.6s to ~1.6s.


Trivial merge