Initial implementation of RFC 2151, Raw Identifiers

This commit is contained in:
Lymia Aluysia
2018-03-09 23:56:40 -06:00
parent 8aa27ee309
commit fad1648e0f
37 changed files with 475 additions and 145 deletions

View File

@@ -112,7 +112,7 @@ impl Path {
// or starts with something like `self`/`super`/`$crate`/etc.
pub fn make_root(&self) -> Option<PathSegment> {
if let Some(ident) = self.segments.get(0).map(|seg| seg.identifier) {
if ::parse::token::Ident(ident).is_path_segment_keyword() &&
if ::parse::token::is_path_segment_keyword(ident) &&
ident.name != keywords::Crate.name() {
return None;
}