@@ -247,7 +247,7 @@ fn allow_single_line_let_else_block(result: &str, block: &ast::Block) -> bool {
247
247
#[ allow( dead_code) ]
248
248
#[ derive( Debug ) ]
249
249
struct Item < ' a > {
250
- unsafety : ast:: Unsafe ,
250
+ safety : ast:: Safety ,
251
251
abi : Cow < ' static , str > ,
252
252
vis : Option < & ' a ast:: Visibility > ,
253
253
body : Vec < BodyElement < ' a > > ,
@@ -257,7 +257,7 @@ struct Item<'a> {
257
257
impl < ' a > Item < ' a > {
258
258
fn from_foreign_mod ( fm : & ' a ast:: ForeignMod , span : Span , config : & Config ) -> Item < ' a > {
259
259
Item {
260
- unsafety : fm. unsafety ,
260
+ safety : fm. safety ,
261
261
abi : format_extern (
262
262
ast:: Extern :: from_abi ( fm. abi , DUMMY_SP ) ,
263
263
config. force_explicit_abi ( ) ,
@@ -290,7 +290,7 @@ pub(crate) struct FnSig<'a> {
290
290
coroutine_kind : Cow < ' a , Option < ast:: CoroutineKind > > ,
291
291
constness : ast:: Const ,
292
292
defaultness : ast:: Defaultness ,
293
- unsafety : ast:: Unsafe ,
293
+ safety : ast:: Safety ,
294
294
visibility : & ' a ast:: Visibility ,
295
295
}
296
296
@@ -301,7 +301,7 @@ impl<'a> FnSig<'a> {
301
301
visibility : & ' a ast:: Visibility ,
302
302
) -> FnSig < ' a > {
303
303
FnSig {
304
- unsafety : method_sig. header . unsafety ,
304
+ safety : method_sig. header . safety ,
305
305
coroutine_kind : Cow :: Borrowed ( & method_sig. header . coroutine_kind ) ,
306
306
constness : method_sig. header . constness ,
307
307
defaultness : ast:: Defaultness :: Final ,
@@ -330,7 +330,7 @@ impl<'a> FnSig<'a> {
330
330
constness : fn_sig. header . constness ,
331
331
coroutine_kind : Cow :: Borrowed ( & fn_sig. header . coroutine_kind ) ,
332
332
defaultness,
333
- unsafety : fn_sig. header . unsafety ,
333
+ safety : fn_sig. header . safety ,
334
334
visibility : vis,
335
335
} ,
336
336
_ => unreachable ! ( ) ,
@@ -345,7 +345,7 @@ impl<'a> FnSig<'a> {
345
345
result. push_str ( format_constness ( self . constness ) ) ;
346
346
self . coroutine_kind
347
347
. map ( |coroutine_kind| result. push_str ( format_coro ( & coroutine_kind) ) ) ;
348
- result. push_str ( format_unsafety ( self . unsafety ) ) ;
348
+ result. push_str ( format_safety ( self . safety ) ) ;
349
349
result. push_str ( & format_extern (
350
350
self . ext ,
351
351
context. config . force_explicit_abi ( ) ,
@@ -356,7 +356,7 @@ impl<'a> FnSig<'a> {
356
356
357
357
impl < ' a > FmtVisitor < ' a > {
358
358
fn format_item ( & mut self , item : & Item < ' _ > ) {
359
- self . buffer . push_str ( format_unsafety ( item. unsafety ) ) ;
359
+ self . buffer . push_str ( format_safety ( item. safety ) ) ;
360
360
self . buffer . push_str ( & item. abi ) ;
361
361
362
362
let snippet = self . snippet ( item. span ) ;
@@ -924,7 +924,7 @@ fn format_impl_ref_and_type(
924
924
offset : Indent ,
925
925
) -> Option < String > {
926
926
let ast:: Impl {
927
- unsafety ,
927
+ safety ,
928
928
polarity,
929
929
defaultness,
930
930
constness,
@@ -937,7 +937,7 @@ fn format_impl_ref_and_type(
937
937
938
938
result. push_str ( & format_visibility ( context, & item. vis ) ) ;
939
939
result. push_str ( format_defaultness ( defaultness) ) ;
940
- result. push_str ( format_unsafety ( unsafety ) ) ;
940
+ result. push_str ( format_safety ( safety ) ) ;
941
941
942
942
let shape = if context. config . version ( ) == Version :: Two {
943
943
Shape :: indented ( offset + last_line_width ( & result) , context. config )
@@ -1137,7 +1137,7 @@ pub(crate) fn format_trait(
1137
1137
} ;
1138
1138
let ast:: Trait {
1139
1139
is_auto,
1140
- unsafety ,
1140
+ safety ,
1141
1141
ref generics,
1142
1142
ref bounds,
1143
1143
ref items,
@@ -1147,7 +1147,7 @@ pub(crate) fn format_trait(
1147
1147
let header = format ! (
1148
1148
"{}{}{}trait " ,
1149
1149
format_visibility( context, & item. vis) ,
1150
- format_unsafety ( unsafety ) ,
1150
+ format_safety ( safety ) ,
1151
1151
format_auto( is_auto) ,
1152
1152
) ;
1153
1153
result. push_str ( & header) ;
0 commit comments