pretty: print attrs in struct expr
This commit is contained in:
parent
bc4a339064
commit
00f0b0cd3a
2 changed files with 17 additions and 0 deletions
|
@ -1749,6 +1749,7 @@ impl<'a> State<'a> {
|
||||||
Consistent,
|
Consistent,
|
||||||
&fields[..],
|
&fields[..],
|
||||||
|s, field| {
|
|s, field| {
|
||||||
|
s.print_outer_attributes(&field.attrs);
|
||||||
s.ibox(INDENT_UNIT);
|
s.ibox(INDENT_UNIT);
|
||||||
if !field.is_shorthand {
|
if !field.is_shorthand {
|
||||||
s.print_ident(field.ident);
|
s.print_ident(field.ident);
|
||||||
|
|
16
src/test/pretty/issue-68710-field-attr-proc-mac-lost.rs
Normal file
16
src/test/pretty/issue-68710-field-attr-proc-mac-lost.rs
Normal 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,};
|
Loading…
Add table
Add a link
Reference in a new issue