From 86cc326d0665997669ca6069c5bb2619e1955f6c Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Fri, 17 May 2019 18:37:53 +1000 Subject: Avoid unnecessary interning in `Ident::from_str()` calls. A lot of these static symbols are pre-interned. --- src/libsyntax/test.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/libsyntax/test.rs') diff --git a/src/libsyntax/test.rs b/src/libsyntax/test.rs index 21bc236d00e..3fd0790161c 100644 --- a/src/libsyntax/test.rs +++ b/src/libsyntax/test.rs @@ -171,7 +171,7 @@ impl MutVisitor for EntryPointCleaner { EntryPointType::MainAttr | EntryPointType::Start => item.map(|ast::Item {id, ident, attrs, node, vis, span, tokens}| { - let allow_ident = Ident::from_str("allow"); + let allow_ident = Ident::with_empty_ctxt(sym::allow); let dc_nested = attr::mk_nested_word_item(Ident::from_str("dead_code")); let allow_dead_code_item = attr::mk_list_item(DUMMY_SP, allow_ident, vec![dc_nested]); @@ -215,7 +215,7 @@ fn mk_reexport_mod(cx: &mut TestCtxt<'_>, tests: Vec, tested_submods: Vec<(Ident, Ident)>) -> (P, Ident) { - let super_ = Ident::from_str("super"); + let super_ = Ident::with_empty_ctxt(keywords::Super.name()); let items = tests.into_iter().map(|r| { cx.ext_cx.item_use_simple(DUMMY_SP, dummy_spanned(ast::VisibilityKind::Public), -- cgit 1.4.1-3-g733a5