@@ -3208,13 +3208,15 @@ impl fmt::Display for Unsafety {
32083208#[ derive( Encodable , Decodable , HashStable_Generic ) ]
32093209pub enum Safety {
32103210 Unsafe ,
3211+ Safe ,
32113212 Default ,
32123213}
32133214
32143215impl Safety {
32153216 pub fn prefix_str ( & self ) -> & ' static str {
32163217 match self {
32173218 Self :: Unsafe => "unsafe " ,
3219+ Self :: Safe => "safe " ,
32183220 Self :: Default => "" ,
32193221 }
32203222 }
@@ -3224,6 +3226,7 @@ impl fmt::Display for Safety {
32243226 fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
32253227 f. write_str ( match * self {
32263228 Self :: Unsafe => "unsafe" ,
3229+ Self :: Safe => "safe" ,
32273230 Self :: Default => "normal" ,
32283231 } )
32293232 }
@@ -3461,9 +3464,9 @@ impl ForeignItem<'_> {
34613464#[ derive( Debug , Clone , Copy , HashStable_Generic ) ]
34623465pub enum ForeignItemKind < ' hir > {
34633466 /// A foreign function.
3464- Fn ( & ' hir FnDecl < ' hir > , & ' hir [ Ident ] , & ' hir Generics < ' hir > ) ,
3467+ Fn ( & ' hir FnDecl < ' hir > , & ' hir [ Ident ] , & ' hir Generics < ' hir > , Safety ) ,
34653468 /// A foreign static item (`static ext: u8`).
3466- Static ( & ' hir Ty < ' hir > , Mutability ) ,
3469+ Static ( & ' hir Ty < ' hir > , Mutability , Safety ) ,
34673470 /// A foreign type.
34683471 Type ,
34693472}
@@ -3533,7 +3536,7 @@ impl<'hir> OwnerNode<'hir> {
35333536 | OwnerNode :: ImplItem ( ImplItem { kind : ImplItemKind :: Fn ( fn_sig, _) , .. } )
35343537 | OwnerNode :: Item ( Item { kind : ItemKind :: Fn ( fn_sig, _, _) , .. } ) => Some ( fn_sig. decl ) ,
35353538 OwnerNode :: ForeignItem ( ForeignItem {
3536- kind : ForeignItemKind :: Fn ( fn_decl, _, _) ,
3539+ kind : ForeignItemKind :: Fn ( fn_decl, _, _, _ ) ,
35373540 ..
35383541 } ) => Some ( fn_decl) ,
35393542 _ => None ,
@@ -3720,9 +3723,9 @@ impl<'hir> Node<'hir> {
37203723 | Node :: ImplItem ( ImplItem { kind : ImplItemKind :: Fn ( fn_sig, _) , .. } )
37213724 | Node :: Item ( Item { kind : ItemKind :: Fn ( fn_sig, _, _) , .. } ) => Some ( fn_sig. decl ) ,
37223725 Node :: Expr ( Expr { kind : ExprKind :: Closure ( Closure { fn_decl, .. } ) , .. } )
3723- | Node :: ForeignItem ( ForeignItem { kind : ForeignItemKind :: Fn ( fn_decl , _ , _ ) , .. } ) => {
3724- Some ( fn_decl)
3725- }
3726+ | Node :: ForeignItem ( ForeignItem {
3727+ kind : ForeignItemKind :: Fn ( fn_decl, _ , _ , _ ) , ..
3728+ } ) => Some ( fn_decl ) ,
37263729 _ => None ,
37273730 }
37283731 }
@@ -3806,7 +3809,7 @@ impl<'hir> Node<'hir> {
38063809 pub fn generics ( self ) -> Option < & ' hir Generics < ' hir > > {
38073810 match self {
38083811 Node :: ForeignItem ( ForeignItem {
3809- kind : ForeignItemKind :: Fn ( _, _, generics) , ..
3812+ kind : ForeignItemKind :: Fn ( _, _, generics, _ ) , ..
38103813 } )
38113814 | Node :: TraitItem ( TraitItem { generics, .. } )
38123815 | Node :: ImplItem ( ImplItem { generics, .. } ) => Some ( generics) ,
0 commit comments