diff options
| author | Jeffrey Seyfried <jeffrey.seyfried@gmail.com> | 2016-03-31 19:10:38 +0000 |
|---|---|---|
| committer | Jeffrey Seyfried <jeffrey.seyfried@gmail.com> | 2016-04-02 20:32:18 +0000 |
| commit | 432eb8a094322a3aa2e40c439f9b50c0d7947d61 (patch) | |
| tree | 4c06b3810117f425326ff2d03201bfca344a6be9 /src/libsyntax/parse | |
| parent | bc355244df5ae74eaabe9a1e19200b9160010505 (diff) | |
| download | rust-432eb8a094322a3aa2e40c439f9b50c0d7947d61.tar.gz rust-432eb8a094322a3aa2e40c439f9b50c0d7947d61.zip | |
Add `Crate` and `Restricted` variants to `ast::Visibility`
Diffstat (limited to 'src/libsyntax/parse')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 8 |
1 files changed, 4 insertions, 4 deletions
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<Attribute> ) -> 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`")); } |
