From: bors Date: Mon, 13 May 2019 00:28:38 +0000 (+0000) Subject: Auto merge of #60630 - nnethercote:use-Symbol-more, r=petrochenkov X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=fe5f42cdb88d8ce31f746130099321e7c95e1ef0;p=rust.git Auto merge of #60630 - nnethercote:use-Symbol-more, r=petrochenkov Use `Symbol` more A `Symbol` can be equated with a string (e.g. `&str`). This involves a TLS lookup to get the chars (and a Mutex lock in a parallel compiler) and then a char-by-char comparison. This functionality is convenient but avoids one of the main benefits of `Symbol`s, which is fast equality comparisons. This PR removes the `Symbol`/string equality operations, forcing a lot of existing string occurrences to become `Symbol`s. Fortunately, these are almost all static strings (many are attribute names) and we can add static `Symbol`s as necessary, and very little extra interning occurs. The benefits are (a) a slight speedup (possibly greater in a parallel compiler), and (b) the code is a lot more principled about `Symbol` use. The main downside is verbosity, particularly with more `use syntax::symbol::symbols` items. r? @Zoxc --- fe5f42cdb88d8ce31f746130099321e7c95e1ef0