]> git.lizzy.rs Git - rust.git/blobdiff - src/libsyntax/parse/token.rs
Clean up raw identifier handling when recovering tokens from AST.
[rust.git] / src / libsyntax / parse / token.rs
index 4e7a282adc5842a38dda60abca5b4ce3e7bdabbe..7798a7a77ee6c8c63e96cd47895759427b6d213b 100644 (file)
@@ -236,7 +236,7 @@ pub fn interpolated(nt: Nonterminal) -> Token {
 
     /// Recovers a `Token` from an `ast::Ident`. This creates a raw identifier if necessary.
     pub fn from_ast_ident(ident: ast::Ident) -> Token {
-        Ident(ident, is_reserved_ident(ident))
+        Ident(ident, is_reserved_ident(ident) && !is_path_segment_keyword(ident))
     }
 
     /// Returns `true` if the token starts with '>'.