From 432eb8a094322a3aa2e40c439f9b50c0d7947d61 Mon Sep 17 00:00:00 2001 From: Jeffrey Seyfried Date: Thu, 31 Mar 2016 19:10:38 +0000 Subject: Add `Crate` and `Restricted` variants to `ast::Visibility` --- src/libsyntax/parse/parser.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/libsyntax/parse') diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 1c0fc5fda25..aff1f77665a 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -3842,7 +3842,7 @@ impl<'a> Parser<'a> { attrs: Vec ) -> PResult<'a, StructField> { let lo = match pr { Visibility::Inherited => self.span.lo, - Visibility::Public => self.last_span.lo, + _ => self.last_span.lo, }; let name = self.parse_ident()?; self.expect(&token::Colon)?; @@ -4970,7 +4970,8 @@ impl<'a> Parser<'a> { fn complain_if_pub_macro(&mut self, visa: &Visibility, span: Span) { match *visa { - Visibility::Public => { + Visibility::Inherited => (), + _ => { let is_macro_rules: bool = match self.token { token::Ident(sid, _) => sid.name == intern("macro_rules"), _ => false, @@ -4988,7 +4989,6 @@ impl<'a> Parser<'a> { .emit(); } } - Visibility::Inherited => (), } } @@ -6096,7 +6096,7 @@ impl<'a> Parser<'a> { // FAILURE TO PARSE ITEM match visibility { Visibility::Inherited => {} - Visibility::Public => { + _ => { let last_span = self.last_span; return Err(self.span_fatal(last_span, "unmatched visibility `pub`")); } -- cgit 1.4.1-3-g733a5