diff options
| author | Jubilee <46493976+workingjubilee@users.noreply.github.com> | 2021-09-24 11:40:12 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-09-24 11:40:12 -0700 |
| commit | 8a454f810190a2ebf75b09991faa802f7c7465a1 (patch) | |
| tree | 83f8f9c6c8712ace6a9b9258a47269e56e782642 /compiler/rustc_span/src | |
| parent | ee2e97c41627e16a818871374add27c03e7e1355 (diff) | |
| parent | df727490b6adf58dc9ceb50440d930a989bd9729 (diff) | |
| download | rust-8a454f810190a2ebf75b09991faa802f7c7465a1.tar.gz rust-8a454f810190a2ebf75b09991faa802f7c7465a1.zip | |
Rollup merge of #89072 - bjorn3:less_symbol_as_str, r=michaelwoerister
Avoid a couple of Symbol::as_str calls in cg_llvm This should improve performance a tiny bit. Also remove `Symbol::len` and make `SymbolIndex` private.
Diffstat (limited to 'compiler/rustc_span/src')
| -rw-r--r-- | compiler/rustc_span/src/symbol.rs | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/compiler/rustc_span/src/symbol.rs b/compiler/rustc_span/src/symbol.rs index 44137290d78..7cb4e18398c 100644 --- a/compiler/rustc_span/src/symbol.rs +++ b/compiler/rustc_span/src/symbol.rs @@ -1618,7 +1618,7 @@ impl fmt::Display for MacroRulesNormalizedIdent { pub struct Symbol(SymbolIndex); rustc_index::newtype_index! { - pub struct SymbolIndex { .. } + struct SymbolIndex { .. } } impl Symbol { @@ -1644,10 +1644,6 @@ impl Symbol { self.0.as_u32() } - pub fn len(self) -> usize { - with_session_globals(|session_globals| session_globals.symbol_interner.get(self).len()) - } - pub fn is_empty(self) -> bool { self == kw::Empty } |
