about summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
Diffstat (limited to 'src/libsyntax/parse')
-rw-r--r--src/libsyntax/parse/diagnostics.rs4
-rw-r--r--src/libsyntax/parse/literal.rs11
2 files changed, 7 insertions, 8 deletions
diff --git a/src/libsyntax/parse/diagnostics.rs b/src/libsyntax/parse/diagnostics.rs
index 1a2393be806..d48fcbbd672 100644
--- a/src/libsyntax/parse/diagnostics.rs
+++ b/src/libsyntax/parse/diagnostics.rs
@@ -6,7 +6,7 @@ use crate::parse::PResult;
 use crate::parse::Parser;
 use crate::print::pprust;
 use crate::ptr::P;
-use crate::symbol::keywords;
+use crate::symbol::kw;
 use crate::ThinVec;
 use errors::{Applicability, DiagnosticBuilder};
 use syntax_pos::Span;
@@ -405,7 +405,7 @@ impl<'a> Parser<'a> {
 
     /// Recover from `pub` keyword in places where it seems _reasonable_ but isn't valid.
     crate fn eat_bad_pub(&mut self) {
-        if self.token.is_keyword(keywords::Pub) {
+        if self.token.is_keyword(kw::Pub) {
             match self.parse_visibility(false) {
                 Ok(vis) => {
                     self.diagnostic()
diff --git a/src/libsyntax/parse/literal.rs b/src/libsyntax/parse/literal.rs
index 6db1a669493..f277f0522b8 100644
--- a/src/libsyntax/parse/literal.rs
+++ b/src/libsyntax/parse/literal.rs
@@ -43,8 +43,8 @@ impl LitKind {
 
         Some(match lit {
             token::Bool(i) => {
-                assert!(i == keywords::True.name() || i == keywords::False.name());
-                LitKind::Bool(i == keywords::True.name())
+                assert!(i == kw::True || i == kw::False);
+                LitKind::Bool(i == kw::True)
             }
             token::Byte(i) => {
                 match unescape_byte(&i.as_str()) {
@@ -156,8 +156,8 @@ impl LitKind {
             }
             LitKind::FloatUnsuffixed(symbol) => (token::Lit::Float(symbol), None),
             LitKind::Bool(value) => {
-                let kw = if value { keywords::True } else { keywords::False };
-                (token::Lit::Bool(kw.name()), None)
+                let kw = if value { kw::True } else { kw::False };
+                (token::Lit::Bool(kw), None)
             }
             LitKind::Err(val) => (token::Lit::Err(val), None),
         }
@@ -175,8 +175,7 @@ impl Lit {
         diag: Option<(Span, &Handler)>,
     ) -> Option<Lit> {
         let (token, suffix) = match *token {
-            token::Ident(ident, false) if ident.name == keywords::True.name() ||
-                                          ident.name == keywords::False.name() =>
+            token::Ident(ident, false) if ident.name == kw::True || ident.name == kw::False =>
                 (token::Bool(ident.name), None),
             token::Literal(token, suffix) =>
                 (token, suffix),