diff options
| author | bors <bors@rust-lang.org> | 2015-09-18 18:51:04 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-09-18 18:51:04 +0000 |
| commit | 72a10fa1d324609d6d946cd7437b1dd0d9dfe0a3 (patch) | |
| tree | 1772b465abffb822364a3b7257f282911de80fe6 /src/libsyntax | |
| parent | dc1c7975b015c14d4c26f2b07ab2b64f5fc66d3c (diff) | |
| parent | a9cb51cf0cf8adc8188097c019daeaf10822d20f (diff) | |
| download | rust-72a10fa1d324609d6d946cd7437b1dd0d9dfe0a3.tar.gz rust-72a10fa1d324609d6d946cd7437b1dd0d9dfe0a3.zip | |
Auto merge of #28442 - nagisa:remove-enum-vis-field, r=alexcrichton
Followup on #28440 Do not merge before the referenced PR is merged. I will fix the PR once that is merged (or close if it is not)
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/ast.rs | 1 | ||||
| -rw-r--r-- | src/libsyntax/config.rs | 3 | ||||
| -rw-r--r-- | src/libsyntax/ext/build.rs | 1 | ||||
| -rw-r--r-- | src/libsyntax/fold.rs | 3 | ||||
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 6 | ||||
| -rw-r--r-- | src/libsyntax/print/pprust.rs | 4 |
6 files changed, 4 insertions, 14 deletions
diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index bf8c67c7ae1..58d92f5001a 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -1614,7 +1614,6 @@ pub struct Variant_ { pub id: NodeId, /// Explicit discriminant, eg `Foo = 1` pub disr_expr: Option<P<Expr>>, - pub vis: Visibility, } pub type Variant = Spanned<Variant_>; diff --git a/src/libsyntax/config.rs b/src/libsyntax/config.rs index faf0b51c8de..889a0d7e440 100644 --- a/src/libsyntax/config.rs +++ b/src/libsyntax/config.rs @@ -141,7 +141,7 @@ fn fold_item_underscore<F>(cx: &mut Context<F>, item: ast::Item_) -> ast::Item_ None } else { Some(v.map(|Spanned {node: ast::Variant_ {id, name, attrs, kind, - disr_expr, vis}, span}| { + disr_expr}, span}| { Spanned { node: ast::Variant_ { id: id, @@ -154,7 +154,6 @@ fn fold_item_underscore<F>(cx: &mut Context<F>, item: ast::Item_) -> ast::Item_ } }, disr_expr: disr_expr, - vis: vis }, span: span } diff --git a/src/libsyntax/ext/build.rs b/src/libsyntax/ext/build.rs index 771ac85ef19..f8beb0e36e2 100644 --- a/src/libsyntax/ext/build.rs +++ b/src/libsyntax/ext/build.rs @@ -1013,7 +1013,6 @@ impl<'a> AstBuilder for ExtCtxt<'a> { kind: ast::TupleVariantKind(args), id: ast::DUMMY_NODE_ID, disr_expr: None, - vis: ast::Public }) } diff --git a/src/libsyntax/fold.rs b/src/libsyntax/fold.rs index 0cfddc9857c..a73cc420eeb 100644 --- a/src/libsyntax/fold.rs +++ b/src/libsyntax/fold.rs @@ -450,7 +450,7 @@ pub fn noop_fold_foreign_mod<T: Folder>(ForeignMod {abi, items}: ForeignMod, } pub fn noop_fold_variant<T: Folder>(v: P<Variant>, fld: &mut T) -> P<Variant> { - v.map(|Spanned {node: Variant_ {id, name, attrs, kind, disr_expr, vis}, span}| Spanned { + v.map(|Spanned {node: Variant_ {id, name, attrs, kind, disr_expr}, span}| Spanned { node: Variant_ { id: fld.new_id(id), name: name, @@ -465,7 +465,6 @@ pub fn noop_fold_variant<T: Folder>(v: P<Variant>, fld: &mut T) -> P<Variant> { } }, disr_expr: disr_expr.map(|e| fld.fold_expr(e)), - vis: vis, }, span: fld.new_span(span), }) diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index a7978babcb7..87500142ccd 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -5185,13 +5185,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; @@ -5233,7 +5230,6 @@ impl<'a> Parser<'a> { kind: kind, id: ast::DUMMY_NODE_ID, disr_expr: disr_expr, - vis: vis, }; variants.push(P(spanned(vlo, self.last_span.hi, vr))); diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index 1d22c83122e..6de6d32dfb3 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -1507,7 +1507,6 @@ impl<'a> State<'a> { } pub fn print_variant(&mut self, v: &ast::Variant) -> io::Result<()> { - try!(self.print_visibility(v.node.vis)); match v.node.kind { ast::TupleVariantKind(ref args) => { try!(self.print_ident(v.node.name)); @@ -3139,11 +3138,10 @@ mod tests { kind: ast::TupleVariantKind(Vec::new()), id: 0, disr_expr: None, - vis: ast::Public, }); let varstr = variant_to_string(&var); - assert_eq!(varstr, "pub principal_skinner"); + assert_eq!(varstr, "principal_skinner"); } #[test] |
