@@ -1290,6 +1290,18 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
1290
1290
attribute is just used for rustc unit \
1291
1291
tests and will never be stable",
1292
1292
cfg_fn ! ( rustc_attrs) ) ) ,
1293
+ ( sym:: rustc_dump_env_program_clauses, Whitelisted , template ! ( Word ) , Gated ( Stability :: Unstable ,
1294
+ sym:: rustc_attrs,
1295
+ "the `#[rustc_dump_env_program_clauses]` \
1296
+ attribute is just used for rustc unit \
1297
+ tests and will never be stable",
1298
+ cfg_fn ! ( rustc_attrs) ) ) ,
1299
+ ( sym:: rustc_object_lifetime_default, Whitelisted , template ! ( Word ) , Gated ( Stability :: Unstable ,
1300
+ sym:: rustc_attrs,
1301
+ "the `#[rustc_object_lifetime_default]` \
1302
+ attribute is just used for rustc unit \
1303
+ tests and will never be stable",
1304
+ cfg_fn ! ( rustc_attrs) ) ) ,
1293
1305
( sym:: rustc_test_marker, Normal , template ! ( Word ) , Gated ( Stability :: Unstable ,
1294
1306
sym:: rustc_attrs,
1295
1307
"the `#[rustc_test_marker]` attribute \
@@ -1351,6 +1363,26 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
1351
1363
"internal implementation detail" ,
1352
1364
cfg_fn ! ( rustc_attrs) ) ) ,
1353
1365
1366
+ ( sym:: rustc_allocator_nounwind, Whitelisted , template ! ( Word ) , Gated ( Stability :: Unstable ,
1367
+ sym:: rustc_attrs,
1368
+ "internal implementation detail" ,
1369
+ cfg_fn ! ( rustc_attrs) ) ) ,
1370
+
1371
+ ( sym:: rustc_doc_only_macro, Whitelisted , template ! ( Word ) , Gated ( Stability :: Unstable ,
1372
+ sym:: rustc_attrs,
1373
+ "internal implementation detail" ,
1374
+ cfg_fn ! ( rustc_attrs) ) ) ,
1375
+
1376
+ ( sym:: rustc_promotable, Whitelisted , template ! ( Word ) , Gated ( Stability :: Unstable ,
1377
+ sym:: rustc_attrs,
1378
+ "internal implementation detail" ,
1379
+ cfg_fn ! ( rustc_attrs) ) ) ,
1380
+
1381
+ ( sym:: rustc_allow_const_fn_ptr, Whitelisted , template ! ( Word ) , Gated ( Stability :: Unstable ,
1382
+ sym:: rustc_attrs,
1383
+ "internal implementation detail" ,
1384
+ cfg_fn ! ( rustc_attrs) ) ) ,
1385
+
1354
1386
( sym:: rustc_dummy, Normal , template ! ( Word /* doesn't matter*/ ) , Gated ( Stability :: Unstable ,
1355
1387
sym:: rustc_attrs,
1356
1388
"used by the test suite" ,
@@ -1647,19 +1679,13 @@ impl<'a> Context<'a> {
1647
1679
return ;
1648
1680
}
1649
1681
}
1650
- if !attr:: is_known ( attr) {
1651
- if attr. name_or_empty ( ) . as_str ( ) . starts_with ( "rustc_" ) {
1652
- let msg = "unless otherwise specified, attributes with the prefix `rustc_` \
1653
- are reserved for internal compiler diagnostics";
1654
- gate_feature ! ( self , rustc_attrs, attr. span, msg) ;
1655
- } else if !is_macro {
1656
- // Only run the custom attribute lint during regular feature gate
1657
- // checking. Macro gating runs before the plugin attributes are
1658
- // registered, so we skip this in that case.
1659
- let msg = format ! ( "The attribute `{}` is currently unknown to the compiler and \
1660
- may have meaning added to it in the future", attr. path) ;
1661
- gate_feature ! ( self , custom_attribute, attr. span, & msg) ;
1662
- }
1682
+ if !is_macro && !attr:: is_known ( attr) {
1683
+ // Only run the custom attribute lint during regular feature gate
1684
+ // checking. Macro gating runs before the plugin attributes are
1685
+ // registered, so we skip this in that case.
1686
+ let msg = format ! ( "The attribute `{}` is currently unknown to the compiler and \
1687
+ may have meaning added to it in the future", attr. path) ;
1688
+ gate_feature ! ( self , custom_attribute, attr. span, & msg) ;
1663
1689
}
1664
1690
}
1665
1691
}
0 commit comments