about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorAlex Burka <alex@alexburka.com>2017-04-02 04:21:12 +0000
committerAlex Burka <alex@alexburka.com>2017-04-15 19:06:19 +0000
commitd53e413e04e438fd0dc1a8b1a8dcb07a0774092a (patch)
treeda424b0fa885a5220711cdd0884aace6dbc68272 /src/libsyntax
parenta2489495d909c43cfbefaeb79db6a77b13908257 (diff)
downloadrust-d53e413e04e438fd0dc1a8b1a8dcb07a0774092a.tar.gz
rust-d53e413e04e438fd0dc1a8b1a8dcb07a0774092a.zip
update :vis implementation to current rust
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/ext/tt/macro_rules.rs12
-rw-r--r--src/libsyntax/parse/parser.rs2
2 files changed, 7 insertions, 7 deletions
diff --git a/src/libsyntax/ext/tt/macro_rules.rs b/src/libsyntax/ext/tt/macro_rules.rs
index 4e197a85ebd..f888e29bdab 100644
--- a/src/libsyntax/ext/tt/macro_rules.rs
+++ b/src/libsyntax/ext/tt/macro_rules.rs
@@ -793,13 +793,13 @@ fn is_in_follow(tok: &quoted::TokenTree, frag: &str) -> Result<bool, (String, &'
             "vis" => {
                 // Explicitly disallow `priv`, on the off chance it comes back.
                 match *tok {
-                    Comma => Ok(true),
-                    ModSep => Ok(true),
-                    MatchNt(_, ref frag, _, _) => {
-                        let name = frag.name.as_str();
-                        Ok(name == "ident" || name == "ty")
+                    TokenTree::Token(_, ref tok) => match *tok {
+                        Comma => Ok(true),
+                        ModSep => Ok(true),
+                        Ident(i) if i.name != "priv" => Ok(true),
+                        _ => Ok(false)
                     },
-                    Ident(i, _) if i.name.as_str() != "priv" => Ok(true),
+                    TokenTree::MetaVarDecl(_, _, frag) if frag.name =="ident" || frag.name == "ty" => Ok(true),
                     _ => Ok(false)
                 }
             },
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index 3b928ea93c7..11becd58293 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -5056,7 +5056,7 @@ impl<'a> Parser<'a> {
     /// and `pub(super)` for `pub(in super)`.  If the following element can't be a tuple (i.e. it's
     /// a function definition, it's not a tuple struct field) and the contents within the parens
     /// isn't valid, emit a proper diagnostic.
-    fn parse_visibility(&mut self, can_take_tuple: bool) -> PResult<'a, Visibility> {
+    pub fn parse_visibility(&mut self, can_take_tuple: bool) -> PResult<'a, Visibility> {
         if !self.eat_keyword(keywords::Pub) {
             return Ok(Visibility::Inherited)
         }