diff options
| author | Alex Burka <alex@alexburka.com> | 2017-04-02 04:46:51 +0000 |
|---|---|---|
| committer | Alex Burka <alex@alexburka.com> | 2017-04-15 19:06:19 +0000 |
| commit | 16010c2f50dd92cc57ccced270a9fb727d6d4883 (patch) | |
| tree | f3a33acda26d3b24bca3932ffe63c3ecea020718 /src/libsyntax | |
| parent | 06411c47694916aaf22ef30b6b8877d7659b2002 (diff) | |
| download | rust-16010c2f50dd92cc57ccced270a9fb727d6d4883.tar.gz rust-16010c2f50dd92cc57ccced270a9fb727d6d4883.zip | |
parse interpolated visibility tokens
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/ext/tt/macro_rules.rs | 3 | ||||
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/src/libsyntax/ext/tt/macro_rules.rs b/src/libsyntax/ext/tt/macro_rules.rs index f888e29bdab..84c909284a8 100644 --- a/src/libsyntax/ext/tt/macro_rules.rs +++ b/src/libsyntax/ext/tt/macro_rules.rs @@ -799,7 +799,8 @@ fn is_in_follow(tok: "ed::TokenTree, frag: &str) -> Result<bool, (String, &' Ident(i) if i.name != "priv" => Ok(true), _ => Ok(false) }, - TokenTree::MetaVarDecl(_, _, frag) if frag.name =="ident" || frag.name == "ty" => 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 11becd58293..31669e1bbe3 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -5057,6 +5057,8 @@ impl<'a> Parser<'a> { /// a function definition, it's not a tuple struct field) and the contents within the parens /// isn't valid, emit a proper diagnostic. pub fn parse_visibility(&mut self, can_take_tuple: bool) -> PResult<'a, Visibility> { + maybe_whole!(self, NtVis, |x| x); + if !self.eat_keyword(keywords::Pub) { return Ok(Visibility::Inherited) } |
