pretty: print attrs in struct expr

This commit is contained in:
Mazdak Farrokhzad 2020-02-01 18:45:03 +01:00
parent bc4a339064
commit 00f0b0cd3a
2 changed files with 17 additions and 0 deletions

View file

@ -1749,6 +1749,7 @@ impl<'a> State<'a> {
Consistent,
&fields[..],
|s, field| {
s.print_outer_attributes(&field.attrs);
s.ibox(INDENT_UNIT);
if !field.is_shorthand {
s.print_ident(field.ident);

View file

@ -0,0 +1,16 @@
// pp-exact
fn main() { }
struct C {
field: u8,
}
#[allow()]
const C: C =
C{
#[cfg(debug_assertions)]
field: 0,
#[cfg(not (debug_assertions))]
field: 1,};