about summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorNicholas Nethercote <nnethercote@mozilla.com>2019-05-17 18:37:53 +1000
committerNicholas Nethercote <nnethercote@mozilla.com>2019-05-17 20:10:50 +1000
commit86cc326d0665997669ca6069c5bb2619e1955f6c (patch)
treecf0e1d660fe5c44ab4f65783479d40146e4bf56f /src/libsyntax/parse
parentbe3724fb7cd416ad3d7016fd3917f0f6a68714c8 (diff)
downloadrust-86cc326d0665997669ca6069c5bb2619e1955f6c.tar.gz
rust-86cc326d0665997669ca6069c5bb2619e1955f6c.zip
Avoid unnecessary interning in `Ident::from_str()` calls.
A lot of these static symbols are pre-interned.
Diffstat (limited to 'src/libsyntax/parse')
-rw-r--r--src/libsyntax/parse/parser.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index b1c3e46adc0..72fedbfdb9f 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -352,7 +352,7 @@ impl TokenCursor {
         let body = TokenTree::Delimited(
             delim_span,
             token::Bracket,
-            [TokenTree::Token(sp, token::Ident(ast::Ident::from_str("doc"), false)),
+            [TokenTree::Token(sp, token::Ident(ast::Ident::with_empty_ctxt(sym::doc), false)),
              TokenTree::Token(sp, token::Eq),
              TokenTree::Token(sp, token::Literal(
                 token::StrRaw(Symbol::intern(&stripped), num_of_hashes), None))
@@ -7012,7 +7012,8 @@ impl<'a> Parser<'a> {
                     let attr = Attribute {
                         id: attr::mk_attr_id(),
                         style: ast::AttrStyle::Outer,
-                        path: ast::Path::from_ident(Ident::from_str("warn_directory_ownership")),
+                        path: ast::Path::from_ident(
+                            Ident::with_empty_ctxt(sym::warn_directory_ownership)),
                         tokens: TokenStream::empty(),
                         is_sugared_doc: false,
                         span: syntax_pos::DUMMY_SP,