Skip to content

Commit e9840d9

Browse files
committed
Print the visibility in print_variant.
1 parent 41601a8 commit e9840d9

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/libsyntax/print/pprust.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1518,6 +1518,7 @@ impl<'a> State<'a> {
15181518

15191519
crate fn print_variant(&mut self, v: &ast::Variant) {
15201520
self.head("");
1521+
self.print_visibility(&v.vis);
15211522
let generics = ast::Generics::default();
15221523
self.print_struct(&v.data, &generics, v.ident, v.span, false);
15231524
match v.disr_expr {

src/test/pretty/enum-variant-vis.rs

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// pp-exact
2+
3+
// Check that the visibility is printed on an enum variant.
4+
5+
fn main() { }
6+
7+
#[cfg(FALSE)]
8+
enum Foo { pub V, }

0 commit comments

Comments
 (0)