-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
Showing
135 changed files
with
1,507 additions
and
1,041 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.