diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 7 | ||||
| -rw-r--r-- | src/test/compile-fail/issue-28433.rs (renamed from src/test/compile-fail/issue-3993-2.rs) | 14 | ||||
| -rw-r--r-- | src/test/compile-fail/useless-pub.rs (renamed from src/test/compile-fail/useless-priv.rs) | 1 |
3 files changed, 7 insertions, 15 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index ff622859cf0..4c257140934 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -5200,13 +5200,10 @@ impl<'a> Parser<'a> { let variant_attrs = self.parse_outer_attributes(); let vlo = self.span.lo; - let vis = try!(self.parse_visibility()); - - let ident; let kind; let mut args = Vec::new(); let mut disr_expr = None; - ident = try!(self.parse_ident()); + let ident = try!(self.parse_ident()); if try!(self.eat(&token::OpenDelim(token::Brace)) ){ // Parse a struct variant. all_nullary = false; @@ -5248,7 +5245,7 @@ impl<'a> Parser<'a> { kind: kind, id: ast::DUMMY_NODE_ID, disr_expr: disr_expr, - vis: vis, + vis: Inherited, }; variants.push(P(spanned(vlo, self.last_span.hi, vr))); diff --git a/src/test/compile-fail/issue-3993-2.rs b/src/test/compile-fail/issue-28433.rs index 9d9e91a141b..ab0708c28ae 100644 --- a/src/test/compile-fail/issue-3993-2.rs +++ b/src/test/compile-fail/issue-28433.rs @@ -1,4 +1,4 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -8,16 +8,12 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use zoo::bird::{duck, goose}; - -mod zoo { - pub enum bird { - pub duck, //~ ERROR: unnecessary `pub` visibility - goose - } +enum bird { + pub duck, //~ ERROR: expected identifier, found keyword `pub` + goose } fn main() { - let y = goose; + let y = bird::goose; } diff --git a/src/test/compile-fail/useless-priv.rs b/src/test/compile-fail/useless-pub.rs index 59964d0df95..fb6cdf7fa59 100644 --- a/src/test/compile-fail/useless-priv.rs +++ b/src/test/compile-fail/useless-pub.rs @@ -9,7 +9,6 @@ // except according to those terms. struct A { pub i: isize } -pub enum C { pub Variant } //~ ERROR: unnecessary `pub` pub trait E { fn foo(&self); |
