File tree Expand file tree Collapse file tree 3 files changed +30
-3
lines changed Expand file tree Collapse file tree 3 files changed +30
-3
lines changed Original file line number Diff line number Diff line change @@ -1916,15 +1916,15 @@ pub(crate) fn rewrite_struct_field_prefix(
19161916 field : & ast:: FieldDef ,
19171917) -> RewriteResult {
19181918 let vis = format_visibility ( context, & field. vis ) ;
1919+ let safety = format_safety ( field. safety ) ;
19191920 let type_annotation_spacing = type_annotation_spacing ( context. config ) ;
19201921 Ok ( match field. ident {
19211922 Some ( name) => format ! (
1922- "{}{}{}:" ,
1923- vis,
1923+ "{vis}{safety}{}{}:" ,
19241924 rewrite_ident( context, name) ,
19251925 type_annotation_spacing. 0
19261926 ) ,
1927- None => vis . to_string ( ) ,
1927+ None => format ! ( "{vis}{safety}" ) ,
19281928 } )
19291929}
19301930
Original file line number Diff line number Diff line change 1+ struct Foo {
2+ unsafe
3+ field: ( ) ,
4+ }
5+
6+ enum Bar {
7+ Variant {
8+ unsafe
9+ field: ( ) ,
10+ } ,
11+ }
12+
13+ union Baz {
14+ unsafe
15+ field: ( ) ,
16+ }
Original file line number Diff line number Diff line change 1+ struct Foo {
2+ unsafe field: ( ) ,
3+ }
4+
5+ enum Bar {
6+ Variant { unsafe field: ( ) } ,
7+ }
8+
9+ union Baz {
10+ unsafe field: ( ) ,
11+ }
You can’t perform that action at this time.
0 commit comments