@@ -432,8 +432,12 @@ impl<'a> AstValidator<'a> {
432432 }
433433 }
434434
435- fn check_foreign_kind_bodyless < D > ( & self , ident : Ident , create_diag : impl FnOnce ( Span , Span , Span ) -> D , body : Option < Span > )
436- where
435+ fn check_foreign_kind_bodyless < D > (
436+ & self ,
437+ ident : Ident ,
438+ create_diag : impl FnOnce ( Span , Span , Span ) -> D ,
439+ body : Option < Span > ,
440+ ) where
437441 D : SessionDiagnostic < ' a > ,
438442 {
439443 let Some ( body) = body else {
@@ -1220,13 +1224,29 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
12201224 ..
12211225 } ) => {
12221226 self . check_defaultness ( fi. span , * defaultness) ;
1223- self . check_foreign_kind_bodyless ( fi. ident , |span, body_span, extern_span| ForeignTyWithBody { span, body_span, extern_span } , ty. as_ref ( ) . map ( |b| b. span ) ) ;
1227+ self . check_foreign_kind_bodyless (
1228+ fi. ident ,
1229+ |span, body_span, extern_span| ForeignTyWithBody {
1230+ span,
1231+ body_span,
1232+ extern_span,
1233+ } ,
1234+ ty. as_ref ( ) . map ( |b| b. span ) ,
1235+ ) ;
12241236 self . check_type_no_bounds ( bounds, |span| ForeignTyWithBound { span } ) ;
12251237 self . check_foreign_ty_genericless ( generics, where_clauses. 0 . 1 ) ;
12261238 self . check_foreign_item_ascii_only ( fi. ident ) ;
12271239 }
12281240 ForeignItemKind :: Static ( _, _, body) => {
1229- self . check_foreign_kind_bodyless ( fi. ident , |span, body_span, extern_span| ForeignStaticWithBody { span, body_span, extern_span } , body. as_ref ( ) . map ( |b| b. span ) ) ;
1241+ self . check_foreign_kind_bodyless (
1242+ fi. ident ,
1243+ |span, body_span, extern_span| ForeignStaticWithBody {
1244+ span,
1245+ body_span,
1246+ extern_span,
1247+ } ,
1248+ body. as_ref ( ) . map ( |b| b. span ) ,
1249+ ) ;
12301250 self . check_foreign_item_ascii_only ( fi. ident ) ;
12311251 }
12321252 ForeignItemKind :: MacCall ( ..) => { }
0 commit comments