AST: Keep distinction between path and ::path in imports and visibilities

Add the root segment for name resolution purposes only
This commit is contained in:
Vadim Petrochenkov
2018-03-10 02:02:39 +03:00
parent b057c554ab
commit e5fb13897d
10 changed files with 66 additions and 77 deletions

View File

@@ -79,7 +79,7 @@ pub fn maybe_inject_crates_ref(mut krate: ast::Crate, alt_std_name: Option<&str>
vis: respan(span.empty(), ast::VisibilityKind::Inherited),
node: ast::ItemKind::Use(P(ast::UseTree {
prefix: ast::Path {
segments: ["{{root}}", name, "prelude", "v1"].into_iter().map(|name| {
segments: [name, "prelude", "v1"].into_iter().map(|name| {
ast::PathSegment::from_ident(ast::Ident::from_str(name), DUMMY_SP)
}).collect(),
span,