Skip to content

Commit f81bd0c

Browse files
committed
Auto merge of #16115 - HKalbasi:rustc-tests-fixup, r=lnicola
Update builtin attrs from rustc Fix #16105 r? `@lnicola` since you did this last time.
2 parents 94af6c6 + 6a40400 commit f81bd0c

File tree

1 file changed

+29
-5
lines changed

1 file changed

+29
-5
lines changed

crates/hir-def/src/attr/builtin.rs

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//!
33
//! The actual definitions were copied from rustc's `compiler/rustc_feature/src/builtin_attrs.rs`.
44
//!
5-
//! It was last synchronized with upstream commit e29821ff85a2a3000d226f99f62f89464028d5d6.
5+
//! It was last synchronized with upstream commit c3def263a44e07e09ae6d57abfc8650227fb4972.
66
//!
77
//! The macros were adjusted to only expand to the attribute name, since that is all we need to do
88
//! name resolution, and `BUILTIN_ATTRIBUTES` is almost entirely unchanged from the original, to
@@ -240,7 +240,7 @@ pub const INERT_ATTRIBUTES: &[BuiltinAttribute] = &[
240240
template!(List: "address, kcfi, memory, thread"), DuplicatesOk,
241241
experimental!(no_sanitize)
242242
),
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)),
244244

245245
ungated!(
246246
doc, Normal, template!(List: "hidden|inline|...", NameValueStr: "string"), DuplicatesOk
@@ -364,7 +364,6 @@ pub const INERT_ATTRIBUTES: &[BuiltinAttribute] = &[
364364
allow_internal_unsafe, Normal, template!(Word), WarnFollowing,
365365
"allow_internal_unsafe side-steps the unsafe_code lint",
366366
),
367-
ungated!(rustc_safe_intrinsic, Normal, template!(Word), DuplicatesOk),
368367
rustc_attr!(rustc_allowed_through_unstable_modules, Normal, template!(Word), WarnFollowing,
369368
"rustc_allowed_through_unstable_modules special cases accidental stabilizations of stable items \
370369
through unstable paths"),
@@ -453,6 +452,12 @@ pub const INERT_ATTRIBUTES: &[BuiltinAttribute] = &[
453452
ErrorFollowing,
454453
INTERNAL_UNSTABLE
455454
),
455+
rustc_attr!(
456+
rustc_confusables, Normal,
457+
template!(List: r#""name1", "name2", ..."#),
458+
ErrorFollowing,
459+
INTERNAL_UNSTABLE,
460+
),
456461
// Enumerates "identity-like" conversion methods to suggest on type mismatch.
457462
rustc_attr!(
458463
rustc_conversion_suggestion, Normal, template!(Word), WarnFollowing, INTERNAL_UNSTABLE
@@ -488,6 +493,10 @@ pub const INERT_ATTRIBUTES: &[BuiltinAttribute] = &[
488493
rustc_attr!(
489494
rustc_do_not_const_check, Normal, template!(Word), WarnFollowing, INTERNAL_UNSTABLE
490495
),
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+
),
491500

492501
// ==========================================================================
493502
// Internal attributes, Layout related:
@@ -520,6 +529,10 @@ pub const INERT_ATTRIBUTES: &[BuiltinAttribute] = &[
520529
rustc_pass_by_value, Normal, template!(Word), ErrorFollowing,
521530
"#[rustc_pass_by_value] is used to mark types that must be passed by value instead of reference."
522531
),
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+
),
523536
rustc_attr!(
524537
rustc_coherence_is_core, AttributeType::CrateLevel, template!(Word), ErrorFollowing, @only_local: true,
525538
"#![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] = &[
533546
"#[rustc_allow_incoherent_impl] has to be added to all impl items of an incoherent inherent impl."
534547
),
535548
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,
537554
"#[rustc_deny_explicit_impl] enforces that a trait can have no user-provided impls"
538555
),
539556
rustc_attr!(
@@ -614,6 +631,10 @@ pub const INERT_ATTRIBUTES: &[BuiltinAttribute] = &[
614631
rustc_doc_primitive, Normal, template!(NameValueStr: "primitive name"), ErrorFollowing,
615632
r#"`rustc_doc_primitive` is a rustc internal attribute"#,
616633
),
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+
),
617638

618639
// ==========================================================================
619640
// Internal attributes, Testing:
@@ -625,13 +646,16 @@ pub const INERT_ATTRIBUTES: &[BuiltinAttribute] = &[
625646
rustc_attr!(TEST, rustc_insignificant_dtor, Normal, template!(Word), WarnFollowing),
626647
rustc_attr!(TEST, rustc_strict_coherence, Normal, template!(Word), WarnFollowing),
627648
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),
628651
rustc_attr!(TEST, rustc_layout, Normal, template!(List: "field1, field2, ..."), WarnFollowing),
652+
rustc_attr!(TEST, rustc_abi, Normal, template!(List: "field1, field2, ..."), WarnFollowing),
629653
rustc_attr!(TEST, rustc_regions, Normal, template!(Word), WarnFollowing),
630654
rustc_attr!(
631655
TEST, rustc_error, Normal,
632656
template!(Word, List: "span_delayed_bug_from_inside_query"), WarnFollowingWordOnly
633657
),
634-
rustc_attr!(TEST, rustc_dump_user_substs, Normal, template!(Word), WarnFollowing),
658+
rustc_attr!(TEST, rustc_dump_user_args, Normal, template!(Word), WarnFollowing),
635659
rustc_attr!(TEST, rustc_evaluate_where_clauses, Normal, template!(Word), WarnFollowing),
636660
rustc_attr!(
637661
TEST, rustc_if_this_changed, Normal, template!(Word, List: "DepNode"), DuplicatesOk

0 commit comments

Comments
 (0)