2
2
//!
3
3
//! The actual definitions were copied from rustc's `compiler/rustc_feature/src/builtin_attrs.rs`.
4
4
//!
5
- //! It was last synchronized with upstream commit e29821ff85a2a3000d226f99f62f89464028d5d6 .
5
+ //! It was last synchronized with upstream commit c3def263a44e07e09ae6d57abfc8650227fb4972 .
6
6
//!
7
7
//! The macros were adjusted to only expand to the attribute name, since that is all we need to do
8
8
//! name resolution, and `BUILTIN_ATTRIBUTES` is almost entirely unchanged from the original, to
@@ -240,7 +240,7 @@ pub const INERT_ATTRIBUTES: &[BuiltinAttribute] = &[
240
240
template!( List : "address, kcfi, memory, thread" ) , DuplicatesOk ,
241
241
experimental!( no_sanitize)
242
242
) ,
243
- gated ! ( coverage, Normal , template!( Word , List : "on|off" ) , WarnFollowing , experimental!( coverage) ) ,
243
+ gated ! ( coverage, Normal , template!( Word , List : "on|off" ) , WarnFollowing , coverage_attribute , experimental!( coverage) ) ,
244
244
245
245
ungated ! (
246
246
doc, Normal , template!( List : "hidden|inline|..." , NameValueStr : "string" ) , DuplicatesOk
@@ -364,7 +364,6 @@ pub const INERT_ATTRIBUTES: &[BuiltinAttribute] = &[
364
364
allow_internal_unsafe, Normal , template!( Word ) , WarnFollowing ,
365
365
"allow_internal_unsafe side-steps the unsafe_code lint" ,
366
366
) ,
367
- ungated ! ( rustc_safe_intrinsic, Normal , template!( Word ) , DuplicatesOk ) ,
368
367
rustc_attr ! ( rustc_allowed_through_unstable_modules, Normal , template!( Word ) , WarnFollowing ,
369
368
"rustc_allowed_through_unstable_modules special cases accidental stabilizations of stable items \
370
369
through unstable paths") ,
@@ -453,6 +452,12 @@ pub const INERT_ATTRIBUTES: &[BuiltinAttribute] = &[
453
452
ErrorFollowing ,
454
453
INTERNAL_UNSTABLE
455
454
) ,
455
+ rustc_attr ! (
456
+ rustc_confusables, Normal ,
457
+ template!( List : r#""name1", "name2", ..."# ) ,
458
+ ErrorFollowing ,
459
+ INTERNAL_UNSTABLE ,
460
+ ) ,
456
461
// Enumerates "identity-like" conversion methods to suggest on type mismatch.
457
462
rustc_attr ! (
458
463
rustc_conversion_suggestion, Normal , template!( Word ) , WarnFollowing , INTERNAL_UNSTABLE
@@ -488,6 +493,10 @@ pub const INERT_ATTRIBUTES: &[BuiltinAttribute] = &[
488
493
rustc_attr ! (
489
494
rustc_do_not_const_check, Normal , template!( Word ) , WarnFollowing , INTERNAL_UNSTABLE
490
495
) ,
496
+ // Ensure the argument to this function is &&str during const-check.
497
+ rustc_attr ! (
498
+ rustc_const_panic_str, Normal , template!( Word ) , WarnFollowing , INTERNAL_UNSTABLE
499
+ ) ,
491
500
492
501
// ==========================================================================
493
502
// Internal attributes, Layout related:
@@ -520,6 +529,10 @@ pub const INERT_ATTRIBUTES: &[BuiltinAttribute] = &[
520
529
rustc_pass_by_value, Normal , template!( Word ) , ErrorFollowing ,
521
530
"#[rustc_pass_by_value] is used to mark types that must be passed by value instead of reference."
522
531
) ,
532
+ rustc_attr ! (
533
+ rustc_never_returns_null_ptr, Normal , template!( Word ) , ErrorFollowing ,
534
+ "#[rustc_never_returns_null_ptr] is used to mark functions returning non-null pointers."
535
+ ) ,
523
536
rustc_attr ! (
524
537
rustc_coherence_is_core, AttributeType :: CrateLevel , template!( Word ) , ErrorFollowing , @only_local: true ,
525
538
"#![rustc_coherence_is_core] allows inherent methods on builtin types, only intended to be used in `core`."
@@ -533,7 +546,11 @@ pub const INERT_ATTRIBUTES: &[BuiltinAttribute] = &[
533
546
"#[rustc_allow_incoherent_impl] has to be added to all impl items of an incoherent inherent impl."
534
547
) ,
535
548
rustc_attr ! (
536
- rustc_deny_explicit_impl, AttributeType :: Normal , template!( Word ) , ErrorFollowing , @only_local: false ,
549
+ rustc_deny_explicit_impl,
550
+ AttributeType :: Normal ,
551
+ template!( List : "implement_via_object = (true|false)" ) ,
552
+ ErrorFollowing ,
553
+ @only_local: true ,
537
554
"#[rustc_deny_explicit_impl] enforces that a trait can have no user-provided impls"
538
555
) ,
539
556
rustc_attr ! (
@@ -614,6 +631,10 @@ pub const INERT_ATTRIBUTES: &[BuiltinAttribute] = &[
614
631
rustc_doc_primitive, Normal , template!( NameValueStr : "primitive name" ) , ErrorFollowing ,
615
632
r#"`rustc_doc_primitive` is a rustc internal attribute"# ,
616
633
) ,
634
+ rustc_attr ! (
635
+ rustc_safe_intrinsic, Normal , template!( Word ) , WarnFollowing ,
636
+ "the `#[rustc_safe_intrinsic]` attribute is used internally to mark intrinsics as safe"
637
+ ) ,
617
638
618
639
// ==========================================================================
619
640
// Internal attributes, Testing:
@@ -625,13 +646,16 @@ pub const INERT_ATTRIBUTES: &[BuiltinAttribute] = &[
625
646
rustc_attr ! ( TEST , rustc_insignificant_dtor, Normal , template!( Word ) , WarnFollowing ) ,
626
647
rustc_attr ! ( TEST , rustc_strict_coherence, Normal , template!( Word ) , WarnFollowing ) ,
627
648
rustc_attr ! ( TEST , rustc_variance, Normal , template!( Word ) , WarnFollowing ) ,
649
+ rustc_attr ! ( TEST , rustc_variance_of_opaques, Normal , template!( Word ) , WarnFollowing ) ,
650
+ rustc_attr ! ( TEST , rustc_hidden_type_of_opaques, Normal , template!( Word ) , WarnFollowing ) ,
628
651
rustc_attr ! ( TEST , rustc_layout, Normal , template!( List : "field1, field2, ..." ) , WarnFollowing ) ,
652
+ rustc_attr ! ( TEST , rustc_abi, Normal , template!( List : "field1, field2, ..." ) , WarnFollowing ) ,
629
653
rustc_attr ! ( TEST , rustc_regions, Normal , template!( Word ) , WarnFollowing ) ,
630
654
rustc_attr ! (
631
655
TEST , rustc_error, Normal ,
632
656
template!( Word , List : "span_delayed_bug_from_inside_query" ) , WarnFollowingWordOnly
633
657
) ,
634
- rustc_attr ! ( TEST , rustc_dump_user_substs , Normal , template!( Word ) , WarnFollowing ) ,
658
+ rustc_attr ! ( TEST , rustc_dump_user_args , Normal , template!( Word ) , WarnFollowing ) ,
635
659
rustc_attr ! ( TEST , rustc_evaluate_where_clauses, Normal , template!( Word ) , WarnFollowing ) ,
636
660
rustc_attr ! (
637
661
TEST , rustc_if_this_changed, Normal , template!( Word , List : "DepNode" ) , DuplicatesOk
0 commit comments