Print the visibility in `print_variant`.

This commit is contained in:
Mazdak Farrokhzad 2019-12-01 23:30:33 +01:00
parent 41601a8c95
commit e9840d94b9
2 changed files with 9 additions and 0 deletions

View File

@ -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 {

View File

@ -0,0 +1,8 @@
// pp-exact
// Check that the visibility is printed on an enum variant.
fn main() { }
#[cfg(FALSE)]
enum Foo { pub V, }