about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>2018-07-06 23:18:38 +0300
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>2018-07-14 14:57:15 +0300
commit7d142c1e53165fea78314117f59e13257d7bf85d (patch)
treeddf1e5cb7e270398948f246c60bc6832b2920320 /src/libsyntax
parente3acb341b2ff743e186c032326d24bfa8827bedc (diff)
downloadrust-7d142c1e53165fea78314117f59e13257d7bf85d.tar.gz
rust-7d142c1e53165fea78314117f59e13257d7bf85d.zip
Address comments
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/ast.rs5
-rw-r--r--src/libsyntax/parse/parser.rs2
-rw-r--r--src/libsyntax/test.rs2
3 files changed, 5 insertions, 4 deletions
diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs
index a7ce4404fb8..209e0b6d787 100644
--- a/src/libsyntax/ast.rs
+++ b/src/libsyntax/ast.rs
@@ -1581,7 +1581,8 @@ impl TyKind {
     pub fn is_implicit_self(&self) -> bool {
         if let TyKind::ImplicitSelf = *self { true } else { false }
     }
-    pub(crate) fn is_empty_tuple(&self) -> bool {
+
+    crate fn is_unit(&self) -> bool {
         if let TyKind::Tup(ref tys) = *self { tys.is_empty() } else { false }
     }
 }
@@ -1982,7 +1983,7 @@ pub enum VisibilityKind {
 }
 
 impl VisibilityKind {
-    pub fn is_public(&self) -> bool {
+    pub fn is_pub(&self) -> bool {
         if let VisibilityKind::Public = *self { true } else { false }
     }
 }
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index 8bd4a7d71d7..62bb5fbd04f 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -6999,7 +6999,7 @@ impl<'a> Parser<'a> {
 
         // Verify whether we have encountered a struct or method definition where the user forgot to
         // add the `struct` or `fn` keyword after writing `pub`: `pub S {}`
-        if visibility.node.is_public() &&
+        if visibility.node.is_pub() &&
             self.check_ident() &&
             self.look_ahead(1, |t| *t != token::Not)
         {
diff --git a/src/libsyntax/test.rs b/src/libsyntax/test.rs
index b4e1dd75b3b..d8b8d13a38c 100644
--- a/src/libsyntax/test.rs
+++ b/src/libsyntax/test.rs
@@ -353,7 +353,7 @@ fn is_test_fn(cx: &TestCtxt, i: &ast::Item) -> bool {
                 // type implements the `Termination` trait as `libtest` enforces that.
                 let has_output = match decl.output {
                     ast::FunctionRetTy::Default(..) => false,
-                    ast::FunctionRetTy::Ty(ref t) if t.node.is_empty_tuple() => false,
+                    ast::FunctionRetTy::Ty(ref t) if t.node.is_unit() => false,
                     _ => true
                 };