diff options
| author | Nicholas Nethercote <nnethercote@mozilla.com> | 2019-05-22 12:42:23 +1000 |
|---|---|---|
| committer | Nicholas Nethercote <nnethercote@mozilla.com> | 2019-05-27 13:58:38 +1000 |
| commit | 26451ef7b5e00887dc8f27717ff34262df23d655 (patch) | |
| tree | 7e369732e649c3404dd2e7fb030c3a032fa0b790 /src/librustc_allocator | |
| parent | 6c0ff3dd979ccaf974312d72a4fba8392eb1a4f7 (diff) | |
| download | rust-26451ef7b5e00887dc8f27717ff34262df23d655.tar.gz rust-26451ef7b5e00887dc8f27717ff34262df23d655.zip | |
Avoid unnecessary internings.
Most involving `Symbol::intern` on string literals.
Diffstat (limited to 'src/librustc_allocator')
| -rw-r--r-- | src/librustc_allocator/expand.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/librustc_allocator/expand.rs b/src/librustc_allocator/expand.rs index b9cd30694f6..3ec06b17aff 100644 --- a/src/librustc_allocator/expand.rs +++ b/src/librustc_allocator/expand.rs @@ -91,9 +91,7 @@ impl MutVisitor for ExpandAllocatorDirectives<'_> { call_site: item.span, // use the call site of the static def_site: None, format: MacroAttribute(Symbol::intern(name)), - allow_internal_unstable: Some(vec![ - Symbol::intern("rustc_attrs"), - ].into()), + allow_internal_unstable: Some(vec![sym::rustc_attrs].into()), allow_internal_unsafe: false, local_inner_macros: false, edition: self.sess.edition, @@ -223,7 +221,7 @@ impl AllocFnFactory<'_> { } fn attrs(&self) -> Vec<Attribute> { - let special = Symbol::intern("rustc_std_internal_symbol"); + let special = sym::rustc_std_internal_symbol; let special = self.cx.meta_word(self.span, special); vec![self.cx.attribute(self.span, special)] } |
