@@ -135,12 +135,17 @@ impl Printer<'_> {
135
135
self . whitespace ( ) ;
136
136
w ! ( self , "{{" ) ;
137
137
self . indented ( |this| {
138
- for ( idx, Field { name, type_ref, visibility } ) in fields. iter ( ) . enumerate ( ) {
138
+ for ( idx, Field { name, type_ref, visibility, is_unsafe } ) in
139
+ fields. iter ( ) . enumerate ( )
140
+ {
139
141
this. print_attrs_of (
140
142
AttrOwner :: Field ( parent, Idx :: from_raw ( RawIdx :: from ( idx as u32 ) ) ) ,
141
143
"\n " ,
142
144
) ;
143
145
this. print_visibility ( * visibility) ;
146
+ if * is_unsafe {
147
+ w ! ( this, "unsafe " ) ;
148
+ }
144
149
w ! ( this, "{}: " , name. display( self . db. upcast( ) , edition) ) ;
145
150
this. print_type_ref ( * type_ref, map) ;
146
151
wln ! ( this, "," ) ;
@@ -151,12 +156,17 @@ impl Printer<'_> {
151
156
FieldsShape :: Tuple => {
152
157
w ! ( self , "(" ) ;
153
158
self . indented ( |this| {
154
- for ( idx, Field { name, type_ref, visibility } ) in fields. iter ( ) . enumerate ( ) {
159
+ for ( idx, Field { name, type_ref, visibility, is_unsafe } ) in
160
+ fields. iter ( ) . enumerate ( )
161
+ {
155
162
this. print_attrs_of (
156
163
AttrOwner :: Field ( parent, Idx :: from_raw ( RawIdx :: from ( idx as u32 ) ) ) ,
157
164
"\n " ,
158
165
) ;
159
166
this. print_visibility ( * visibility) ;
167
+ if * is_unsafe {
168
+ w ! ( this, "unsafe " ) ;
169
+ }
160
170
w ! ( this, "{}: " , name. display( self . db. upcast( ) , edition) ) ;
161
171
this. print_type_ref ( * type_ref, map) ;
162
172
wln ! ( this, "," ) ;
0 commit comments