@@ -432,8 +432,12 @@ impl<'a> AstValidator<'a> {
432
432
}
433
433
}
434
434
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
437
441
D : SessionDiagnostic < ' a > ,
438
442
{
439
443
let Some ( body) = body else {
@@ -1220,13 +1224,29 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
1220
1224
..
1221
1225
} ) => {
1222
1226
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
+ ) ;
1224
1236
self . check_type_no_bounds ( bounds, |span| ForeignTyWithBound { span } ) ;
1225
1237
self . check_foreign_ty_genericless ( generics, where_clauses. 0 . 1 ) ;
1226
1238
self . check_foreign_item_ascii_only ( fi. ident ) ;
1227
1239
}
1228
1240
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
+ ) ;
1230
1250
self . check_foreign_item_ascii_only ( fi. ident ) ;
1231
1251
}
1232
1252
ForeignItemKind :: MacCall ( ..) => { }
0 commit comments