@@ -135,12 +135,17 @@ impl Printer<'_> {
135135 self . whitespace ( ) ;
136136 w ! ( self , "{{" ) ;
137137 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+ {
139141 this. print_attrs_of (
140142 AttrOwner :: Field ( parent, Idx :: from_raw ( RawIdx :: from ( idx as u32 ) ) ) ,
141143 "\n " ,
142144 ) ;
143145 this. print_visibility ( * visibility) ;
146+ if * is_unsafe {
147+ w ! ( this, "unsafe " ) ;
148+ }
144149 w ! ( this, "{}: " , name. display( self . db. upcast( ) , edition) ) ;
145150 this. print_type_ref ( * type_ref, map) ;
146151 wln ! ( this, "," ) ;
@@ -151,12 +156,17 @@ impl Printer<'_> {
151156 FieldsShape :: Tuple => {
152157 w ! ( self , "(" ) ;
153158 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+ {
155162 this. print_attrs_of (
156163 AttrOwner :: Field ( parent, Idx :: from_raw ( RawIdx :: from ( idx as u32 ) ) ) ,
157164 "\n " ,
158165 ) ;
159166 this. print_visibility ( * visibility) ;
167+ if * is_unsafe {
168+ w ! ( this, "unsafe " ) ;
169+ }
160170 w ! ( this, "{}: " , name. display( self . db. upcast( ) , edition) ) ;
161171 this. print_type_ref ( * type_ref, map) ;
162172 wln ! ( this, "," ) ;
0 commit comments