From 26451ef7b5e00887dc8f27717ff34262df23d655 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Wed, 22 May 2019 12:42:23 +1000 Subject: Avoid unnecessary internings. Most involving `Symbol::intern` on string literals. --- src/librustc_allocator/expand.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/librustc_allocator') 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 { - 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)] } -- cgit 1.4.1-3-g733a5