Skip to content

Commit

Permalink
Print the visibility in print_variant.
Browse files Browse the repository at this point in the history
  • Loading branch information
Centril committed Dec 7, 2019
1 parent 41601a8 commit e9840d9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/libsyntax/print/pprust.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1518,6 +1518,7 @@ impl<'a> State<'a> {

crate fn print_variant(&mut self, v: &ast::Variant) {
self.head("");
self.print_visibility(&v.vis);
let generics = ast::Generics::default();
self.print_struct(&v.data, &generics, v.ident, v.span, false);
match v.disr_expr {
Expand Down
8 changes: 8 additions & 0 deletions src/test/pretty/enum-variant-vis.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// pp-exact

// Check that the visibility is printed on an enum variant.

fn main() { }

#[cfg(FALSE)]
enum Foo { pub V, }

0 comments on commit e9840d9

Please sign in to comment.