Simplify use of keyword symbols
This commit is contained in:
@@ -2,7 +2,7 @@ use crate::ast;
|
||||
use crate::attr;
|
||||
use crate::edition::Edition;
|
||||
use crate::ext::hygiene::{Mark, SyntaxContext};
|
||||
use crate::symbol::{Ident, Symbol, keywords, sym};
|
||||
use crate::symbol::{Ident, Symbol, kw, sym};
|
||||
use crate::source_map::{ExpnInfo, MacroAttribute, dummy_spanned, respan};
|
||||
use crate::ptr::P;
|
||||
use crate::tokenstream::TokenStream;
|
||||
@@ -107,7 +107,7 @@ pub fn maybe_inject_crates_ref(
|
||||
vis: respan(span.shrink_to_lo(), ast::VisibilityKind::Inherited),
|
||||
node: ast::ItemKind::Use(P(ast::UseTree {
|
||||
prefix: ast::Path {
|
||||
segments: iter::once(keywords::PathRoot.ident())
|
||||
segments: iter::once(ast::Ident::with_empty_ctxt(kw::PathRoot))
|
||||
.chain(
|
||||
[name, "prelude", "v1"].iter().cloned()
|
||||
.map(ast::Ident::from_str)
|
||||
@@ -118,7 +118,7 @@ pub fn maybe_inject_crates_ref(
|
||||
span,
|
||||
})),
|
||||
id: ast::DUMMY_NODE_ID,
|
||||
ident: keywords::Invalid.ident(),
|
||||
ident: ast::Ident::with_empty_ctxt(kw::Invalid),
|
||||
span,
|
||||
tokens: None,
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user