summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--compiler/rustc_attr_data_structures/src/attributes.rs1
-rw-r--r--compiler/rustc_attr_parsing/src/attributes/repr.rs2
-rw-r--r--compiler/rustc_feature/src/builtin_attrs.rs3
-rw-r--r--compiler/rustc_middle/src/middle/codegen_fn_attrs.rs1
-rw-r--r--compiler/rustc_parse/src/validate_attr.rs3
-rw-r--r--compiler/rustc_passes/messages.ftl4
-rw-r--r--compiler/rustc_passes/src/check_attr.rs4
-rw-r--r--compiler/rustc_span/src/symbol.rs2
-rw-r--r--src/tools/miri/tests/pass/fn_align.rs10
-rw-r--r--tests/codegen/align-fn.rs26
-rw-r--r--tests/codegen/min-function-alignment.rs6
-rw-r--r--tests/codegen/naked-fn/aligned.rs5
-rw-r--r--tests/codegen/naked-fn/min-function-alignment.rs6
-rw-r--r--tests/ui/asm/naked-with-invalid-repr-attr.rs6
-rw-r--r--tests/ui/asm/naked-with-invalid-repr-attr.stderr12
-rw-r--r--tests/ui/attributes/fn-align-nameres-ambiguity-143834.rs10
-rw-r--r--tests/ui/attributes/fn-align-nameres-ambiguity-143834.stderr22
-rw-r--r--tests/ui/attributes/malformed-fn-align.rs17
-rw-r--r--tests/ui/attributes/malformed-fn-align.stderr62
-rw-r--r--tests/ui/feature-gates/feature-gate-fn_align.rs14
-rw-r--r--tests/ui/feature-gates/feature-gate-fn_align.stderr26
21 files changed, 126 insertions, 116 deletions
diff --git a/compiler/rustc_attr_data_structures/src/attributes.rs b/compiler/rustc_attr_data_structures/src/attributes.rs
index c7487847e6f..e27aa8e3614 100644
--- a/compiler/rustc_attr_data_structures/src/attributes.rs
+++ b/compiler/rustc_attr_data_structures/src/attributes.rs
@@ -184,6 +184,7 @@ impl Deprecation {
 pub enum AttributeKind {
     // tidy-alphabetical-start
     /// Represents `#[align(N)]`.
+    // FIXME(#82232, #143834): temporarily renamed to mitigate `#[align]` nameres ambiguity
     Align { align: Align, span: Span },
 
     /// Represents `#[rustc_allow_const_fn_unstable]`.
diff --git a/compiler/rustc_attr_parsing/src/attributes/repr.rs b/compiler/rustc_attr_parsing/src/attributes/repr.rs
index 4aa27043e98..8ec1dcd9690 100644
--- a/compiler/rustc_attr_parsing/src/attributes/repr.rs
+++ b/compiler/rustc_attr_parsing/src/attributes/repr.rs
@@ -273,7 +273,7 @@ fn parse_alignment(node: &LitKind) -> Result<Align, &'static str> {
 pub(crate) struct AlignParser(Option<(Align, Span)>);
 
 impl AlignParser {
-    const PATH: &'static [Symbol] = &[sym::align];
+    const PATH: &'static [Symbol] = &[sym::rustc_align];
     const TEMPLATE: AttributeTemplate = template!(List: "<alignment in bytes>");
 
     fn parse<'c, S: Stage>(
diff --git a/compiler/rustc_feature/src/builtin_attrs.rs b/compiler/rustc_feature/src/builtin_attrs.rs
index 280b33f0723..b309c49ac19 100644
--- a/compiler/rustc_feature/src/builtin_attrs.rs
+++ b/compiler/rustc_feature/src/builtin_attrs.rs
@@ -495,7 +495,8 @@ pub static BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
     ),
     ungated!(no_link, Normal, template!(Word), WarnFollowing, EncodeCrossCrate::No),
     ungated!(repr, Normal, template!(List: "C"), DuplicatesOk, EncodeCrossCrate::No),
-    gated!(align, Normal, template!(List: "alignment"), DuplicatesOk, EncodeCrossCrate::No, fn_align, experimental!(align)),
+    // FIXME(#82232, #143834): temporarily renamed to mitigate `#[align]` nameres ambiguity
+    gated!(rustc_align, Normal, template!(List: "alignment"), DuplicatesOk, EncodeCrossCrate::No, fn_align, experimental!(rustc_align)),
     ungated!(unsafe(Edition2024) export_name, Normal, template!(NameValueStr: "name"), FutureWarnPreceding, EncodeCrossCrate::No),
     ungated!(unsafe(Edition2024) link_section, Normal, template!(NameValueStr: "name"), FutureWarnPreceding, EncodeCrossCrate::No),
     ungated!(unsafe(Edition2024) no_mangle, Normal, template!(Word), WarnFollowing, EncodeCrossCrate::No),
diff --git a/compiler/rustc_middle/src/middle/codegen_fn_attrs.rs b/compiler/rustc_middle/src/middle/codegen_fn_attrs.rs
index 2f16d385efb..8d905862c64 100644
--- a/compiler/rustc_middle/src/middle/codegen_fn_attrs.rs
+++ b/compiler/rustc_middle/src/middle/codegen_fn_attrs.rs
@@ -48,6 +48,7 @@ pub struct CodegenFnAttrs {
     /// switching between multiple instruction sets.
     pub instruction_set: Option<InstructionSetAttr>,
     /// The `#[align(...)]` attribute. Determines the alignment of the function body.
+    // FIXME(#82232, #143834): temporarily renamed to mitigate `#[align]` nameres ambiguity
     pub alignment: Option<Align>,
     /// The `#[patchable_function_entry(...)]` attribute. Indicates how many nops should be around
     /// the function entry.
diff --git a/compiler/rustc_parse/src/validate_attr.rs b/compiler/rustc_parse/src/validate_attr.rs
index 8e6442353c3..8599022b935 100644
--- a/compiler/rustc_parse/src/validate_attr.rs
+++ b/compiler/rustc_parse/src/validate_attr.rs
@@ -289,7 +289,8 @@ fn emit_malformed_attribute(
             | sym::rustc_force_inline
             | sym::rustc_confusables
             | sym::repr
-            | sym::align
+            // FIXME(#82232, #143834): temporarily renamed to mitigate `#[align]` nameres ambiguity
+            | sym::rustc_align
             | sym::deprecated
             | sym::optimize
             | sym::cold
diff --git a/compiler/rustc_passes/messages.ftl b/compiler/rustc_passes/messages.ftl
index c1a2b3b2973..9dbdbd23b7b 100644
--- a/compiler/rustc_passes/messages.ftl
+++ b/compiler/rustc_passes/messages.ftl
@@ -14,7 +14,7 @@ passes_abi_of =
     fn_abi_of({$fn_name}) = {$fn_abi}
 
 passes_align_should_be_repr_align =
-    `#[align(...)]` is not supported on {$item} items
+    `#[rustc_align(...)]` is not supported on {$item} items
     .suggestion = use `#[repr(align(...))]` instead
 
 passes_allow_incoherent_impl =
@@ -589,7 +589,7 @@ passes_repr_align_greater_than_target_max =
 
 passes_repr_align_should_be_align =
     `#[repr(align(...))]` is not supported on {$item} items
-    .help = use `#[align(...)]` instead
+    .help = use `#[rustc_align(...)]` instead
 
 passes_repr_conflicting =
     conflicting representation hints
diff --git a/compiler/rustc_passes/src/check_attr.rs b/compiler/rustc_passes/src/check_attr.rs
index ad1a2a04273..f6d7af541a6 100644
--- a/compiler/rustc_passes/src/check_attr.rs
+++ b/compiler/rustc_passes/src/check_attr.rs
@@ -662,7 +662,8 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
             sym::naked,
             sym::instruction_set,
             sym::repr,
-            sym::align,
+            // FIXME(#82232, #143834): temporarily renamed to mitigate `#[align]` nameres ambiguity
+            sym::rustc_align,
             sym::rustc_std_internal_symbol,
             // documentation
             sym::doc,
@@ -1996,6 +1997,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
     }
 
     /// Checks if the `#[align]` attributes on `item` are valid.
+    // FIXME(#82232, #143834): temporarily renamed to mitigate `#[align]` nameres ambiguity
     fn check_align(&self, span: Span, target: Target, align: Align, repr_span: Span) {
         match target {
             Target::Fn | Target::Method(_) => {}
diff --git a/compiler/rustc_span/src/symbol.rs b/compiler/rustc_span/src/symbol.rs
index 684b1781b44..8c9f18f50a3 100644
--- a/compiler/rustc_span/src/symbol.rs
+++ b/compiler/rustc_span/src/symbol.rs
@@ -1806,6 +1806,8 @@ symbols! {
         rust_out,
         rustc,
         rustc_abi,
+        // FIXME(#82232, #143834): temporary name to mitigate `#[align]` nameres ambiguity
+        rustc_align,
         rustc_allocator,
         rustc_allocator_zeroed,
         rustc_allow_const_fn_unstable,
diff --git a/src/tools/miri/tests/pass/fn_align.rs b/src/tools/miri/tests/pass/fn_align.rs
index 28f92995880..9752d033458 100644
--- a/src/tools/miri/tests/pass/fn_align.rs
+++ b/src/tools/miri/tests/pass/fn_align.rs
@@ -1,15 +1,19 @@
 //@compile-flags: -Zmin-function-alignment=8
+
+// FIXME(rust-lang/rust#82232, rust-lang/rust#143834): temporarily renamed to mitigate `#[align]`
+// nameres ambiguity
+#![feature(rustc_attrs)]
 #![feature(fn_align)]
 
 // When a function uses `align(N)`, the function address should be a multiple of `N`.
 
-#[align(256)]
+#[rustc_align(256)]
 fn foo() {}
 
-#[align(16)]
+#[rustc_align(16)]
 fn bar() {}
 
-#[align(4)]
+#[rustc_align(4)]
 fn baz() {}
 
 fn main() {
diff --git a/tests/codegen/align-fn.rs b/tests/codegen/align-fn.rs
index 267da060240..f30b63f96d5 100644
--- a/tests/codegen/align-fn.rs
+++ b/tests/codegen/align-fn.rs
@@ -1,11 +1,13 @@
 //@ compile-flags: -C no-prepopulate-passes -Z mir-opt-level=0
 
 #![crate_type = "lib"]
+// FIXME(#82232, #143834): temporarily renamed to mitigate `#[align]` nameres ambiguity
+#![feature(rustc_attrs)]
 #![feature(fn_align)]
 
 // CHECK: align 16
 #[no_mangle]
-#[align(16)]
+#[rustc_align(16)]
 pub fn fn_align() {}
 
 pub struct A;
@@ -13,12 +15,12 @@ pub struct A;
 impl A {
     // CHECK: align 16
     #[no_mangle]
-    #[align(16)]
+    #[rustc_align(16)]
     pub fn method_align(self) {}
 
     // CHECK: align 16
     #[no_mangle]
-    #[align(16)]
+    #[rustc_align(16)]
     pub fn associated_fn() {}
 }
 
@@ -26,19 +28,19 @@ trait T: Sized {
     fn trait_fn() {}
 
     // CHECK: align 32
-    #[align(32)]
+    #[rustc_align(32)]
     fn trait_method(self) {}
 }
 
 impl T for A {
     // CHECK: align 16
     #[no_mangle]
-    #[align(16)]
+    #[rustc_align(16)]
     fn trait_fn() {}
 
     // CHECK: align 16
     #[no_mangle]
-    #[align(16)]
+    #[rustc_align(16)]
     fn trait_method(self) {}
 }
 
@@ -51,20 +53,20 @@ pub fn foo() {
 // CHECK-LABEL: align_specified_twice_1
 // CHECK-SAME: align 64
 #[no_mangle]
-#[align(32)]
-#[align(64)]
+#[rustc_align(32)]
+#[rustc_align(64)]
 pub fn align_specified_twice_1() {}
 
 // CHECK-LABEL: align_specified_twice_2
 // CHECK-SAME: align 128
 #[no_mangle]
-#[align(128)]
-#[align(32)]
+#[rustc_align(128)]
+#[rustc_align(32)]
 pub fn align_specified_twice_2() {}
 
 // CHECK-LABEL: align_specified_twice_3
 // CHECK-SAME: align 256
 #[no_mangle]
-#[align(32)]
-#[align(256)]
+#[rustc_align(32)]
+#[rustc_align(256)]
 pub fn align_specified_twice_3() {}
diff --git a/tests/codegen/min-function-alignment.rs b/tests/codegen/min-function-alignment.rs
index 75f845572a4..8ae2614e23e 100644
--- a/tests/codegen/min-function-alignment.rs
+++ b/tests/codegen/min-function-alignment.rs
@@ -4,6 +4,8 @@
 //@ [align1024] compile-flags: -Zmin-function-alignment=1024
 
 #![crate_type = "lib"]
+// FIXME(#82232, #143834): temporarily renamed to mitigate `#[align]` nameres ambiguity
+#![feature(rustc_attrs)]
 #![feature(fn_align)]
 
 // functions without explicit alignment use the global minimum
@@ -18,7 +20,7 @@ pub fn no_explicit_align() {}
 // align16: align 16
 // align1024: align 1024
 #[no_mangle]
-#[align(8)]
+#[rustc_align(8)]
 pub fn lower_align() {}
 
 // the higher value of min-function-alignment and the align attribute wins out
@@ -27,7 +29,7 @@ pub fn lower_align() {}
 // align16: align 32
 // align1024: align 1024
 #[no_mangle]
-#[align(32)]
+#[rustc_align(32)]
 pub fn higher_align() {}
 
 // cold functions follow the same rules as other functions
diff --git a/tests/codegen/naked-fn/aligned.rs b/tests/codegen/naked-fn/aligned.rs
index f9fce8e5a5d..5b542043718 100644
--- a/tests/codegen/naked-fn/aligned.rs
+++ b/tests/codegen/naked-fn/aligned.rs
@@ -3,12 +3,15 @@
 //@ ignore-arm no "ret" mnemonic
 
 #![crate_type = "lib"]
+// FIXME(#82232, #143834): temporarily renamed to mitigate `#[align]` nameres ambiguity
+#![feature(rustc_attrs)]
 #![feature(fn_align)]
+
 use std::arch::naked_asm;
 
 // CHECK: .balign 16
 // CHECK-LABEL: naked_empty:
-#[align(16)]
+#[rustc_align(16)]
 #[no_mangle]
 #[unsafe(naked)]
 pub extern "C" fn naked_empty() {
diff --git a/tests/codegen/naked-fn/min-function-alignment.rs b/tests/codegen/naked-fn/min-function-alignment.rs
index 59554c1cae5..2db5b73cba4 100644
--- a/tests/codegen/naked-fn/min-function-alignment.rs
+++ b/tests/codegen/naked-fn/min-function-alignment.rs
@@ -2,6 +2,8 @@
 //@ needs-asm-support
 //@ ignore-arm no "ret" mnemonic
 
+// FIXME(#82232, #143834): temporarily renamed to mitigate `#[align]` nameres ambiguity
+#![feature(rustc_attrs)]
 #![feature(fn_align)]
 #![crate_type = "lib"]
 
@@ -16,7 +18,7 @@ pub extern "C" fn naked_no_explicit_align() {
 
 // CHECK: .balign 16
 #[no_mangle]
-#[align(8)]
+#[rustc_align(8)]
 #[unsafe(naked)]
 pub extern "C" fn naked_lower_align() {
     core::arch::naked_asm!("ret")
@@ -24,7 +26,7 @@ pub extern "C" fn naked_lower_align() {
 
 // CHECK: .balign 32
 #[no_mangle]
-#[align(32)]
+#[rustc_align(32)]
 #[unsafe(naked)]
 pub extern "C" fn naked_higher_align() {
     core::arch::naked_asm!("ret")
diff --git a/tests/ui/asm/naked-with-invalid-repr-attr.rs b/tests/ui/asm/naked-with-invalid-repr-attr.rs
index bfbbf29a69e..4620d007e4e 100644
--- a/tests/ui/asm/naked-with-invalid-repr-attr.rs
+++ b/tests/ui/asm/naked-with-invalid-repr-attr.rs
@@ -1,5 +1,9 @@
 //@ needs-asm-support
+
+// FIXME(#82232, #143834): temporarily renamed to mitigate `#[align]` nameres ambiguity
+#![feature(rustc_attrs)]
 #![feature(fn_align)]
+
 #![crate_type = "lib"]
 use std::arch::naked_asm;
 
@@ -21,7 +25,7 @@ extern "C" fn example2() {
 
 #[repr(C)]
 //~^ ERROR attribute should be applied to a struct, enum, or union [E0517]
-#[align(16)]
+#[rustc_align(16)]
 #[unsafe(naked)]
 extern "C" fn example3() {
     //~^ NOTE not a struct, enum, or union
diff --git a/tests/ui/asm/naked-with-invalid-repr-attr.stderr b/tests/ui/asm/naked-with-invalid-repr-attr.stderr
index 4eb4a4e5a04..8530495be66 100644
--- a/tests/ui/asm/naked-with-invalid-repr-attr.stderr
+++ b/tests/ui/asm/naked-with-invalid-repr-attr.stderr
@@ -1,5 +1,5 @@
 error[E0517]: attribute should be applied to a struct, enum, or union
-  --> $DIR/naked-with-invalid-repr-attr.rs:6:8
+  --> $DIR/naked-with-invalid-repr-attr.rs:10:8
    |
 LL |   #[repr(C)]
    |          ^
@@ -11,7 +11,7 @@ LL | | }
    | |_- not a struct, enum, or union
 
 error[E0517]: attribute should be applied to a struct, enum, or union
-  --> $DIR/naked-with-invalid-repr-attr.rs:14:8
+  --> $DIR/naked-with-invalid-repr-attr.rs:18:8
    |
 LL |   #[repr(transparent)]
    |          ^^^^^^^^^^^
@@ -23,7 +23,7 @@ LL | | }
    | |_- not a struct, enum, or union
 
 error[E0517]: attribute should be applied to a struct, enum, or union
-  --> $DIR/naked-with-invalid-repr-attr.rs:22:8
+  --> $DIR/naked-with-invalid-repr-attr.rs:26:8
    |
 LL |   #[repr(C)]
    |          ^
@@ -35,7 +35,7 @@ LL | | }
    | |_- not a struct, enum, or union
 
 error[E0517]: attribute should be applied to a struct, enum, or union
-  --> $DIR/naked-with-invalid-repr-attr.rs:32:8
+  --> $DIR/naked-with-invalid-repr-attr.rs:36:8
    |
 LL |   #[repr(C, packed)]
    |          ^
@@ -48,7 +48,7 @@ LL | | }
    | |_- not a struct, enum, or union
 
 error[E0517]: attribute should be applied to a struct or union
-  --> $DIR/naked-with-invalid-repr-attr.rs:32:11
+  --> $DIR/naked-with-invalid-repr-attr.rs:36:11
    |
 LL |   #[repr(C, packed)]
    |             ^^^^^^
@@ -61,7 +61,7 @@ LL | | }
    | |_- not a struct or union
 
 error[E0517]: attribute should be applied to an enum
-  --> $DIR/naked-with-invalid-repr-attr.rs:42:8
+  --> $DIR/naked-with-invalid-repr-attr.rs:46:8
    |
 LL |   #[repr(u8)]
    |          ^^
diff --git a/tests/ui/attributes/fn-align-nameres-ambiguity-143834.rs b/tests/ui/attributes/fn-align-nameres-ambiguity-143834.rs
index 5629f92c468..536d6ff43fb 100644
--- a/tests/ui/attributes/fn-align-nameres-ambiguity-143834.rs
+++ b/tests/ui/attributes/fn-align-nameres-ambiguity-143834.rs
@@ -1,21 +1,19 @@
-//~ NOTE `align` could refer to a built-in attribute
-
 // Anti-regression test to demonstrate that at least we mitigated breakage from adding a new
 // `#[align]` built-in attribute.
+//
+// See https://github.com/rust-lang/rust/issues/143834.
+
+//@ check-pass
 
 // Needs edition >= 2018 macro use behavior.
 //@ edition: 2018
 
 macro_rules! align {
-    //~^ NOTE `align` could also refer to the macro defined here
     () => {
         /* .. */
     };
 }
 
 pub(crate) use align;
-//~^ ERROR `align` is ambiguous
-//~| NOTE ambiguous name
-//~| NOTE ambiguous because of a name conflict with a builtin attribute
 
 fn main() {}
diff --git a/tests/ui/attributes/fn-align-nameres-ambiguity-143834.stderr b/tests/ui/attributes/fn-align-nameres-ambiguity-143834.stderr
deleted file mode 100644
index 304537173a8..00000000000
--- a/tests/ui/attributes/fn-align-nameres-ambiguity-143834.stderr
+++ /dev/null
@@ -1,22 +0,0 @@
-error[E0659]: `align` is ambiguous
-  --> $DIR/fn-align-nameres-ambiguity-143834.rs:16:16
-   |
-LL | pub(crate) use align;
-   |                ^^^^^ ambiguous name
-   |
-   = note: ambiguous because of a name conflict with a builtin attribute
-   = note: `align` could refer to a built-in attribute
-note: `align` could also refer to the macro defined here
-  --> $DIR/fn-align-nameres-ambiguity-143834.rs:9:1
-   |
-LL | / macro_rules! align {
-LL | |
-LL | |     () => {
-LL | |         /* .. */
-LL | |     };
-LL | | }
-   | |_^
-
-error: aborting due to 1 previous error
-
-For more information about this error, try `rustc --explain E0659`.
diff --git a/tests/ui/attributes/malformed-fn-align.rs b/tests/ui/attributes/malformed-fn-align.rs
index f5ab9555e56..da5284fd4bd 100644
--- a/tests/ui/attributes/malformed-fn-align.rs
+++ b/tests/ui/attributes/malformed-fn-align.rs
@@ -1,25 +1,30 @@
+// ignore-tidy-linelength
+
+// FIXME(#82232, #143834): temporarily renamed to mitigate `#[align]` nameres ambiguity
+#![feature(rustc_attrs)]
 #![feature(fn_align)]
+
 #![crate_type = "lib"]
 
 trait MyTrait {
-    #[align] //~ ERROR malformed `align` attribute input
+    #[rustc_align] //~ ERROR malformed `rustc_align` attribute input
     fn myfun1();
 
-    #[align(1, 2)] //~ ERROR malformed `align` attribute input
+    #[rustc_align(1, 2)] //~ ERROR malformed `rustc_align` attribute input
     fn myfun2();
 }
 
-#[align = 16] //~ ERROR malformed `align` attribute input
+#[rustc_align = 16] //~ ERROR malformed `rustc_align` attribute input
 fn f1() {}
 
-#[align("hello")] //~ ERROR invalid alignment value: not an unsuffixed integer
+#[rustc_align("hello")] //~ ERROR invalid alignment value: not an unsuffixed integer
 fn f2() {}
 
-#[align(0)] //~ ERROR invalid alignment value: not a power of two
+#[rustc_align(0)] //~ ERROR invalid alignment value: not a power of two
 fn f3() {}
 
 #[repr(align(16))] //~ ERROR `#[repr(align(...))]` is not supported on function items
 fn f4() {}
 
-#[align(16)] //~ ERROR `#[align(...)]` is not supported on struct items
+#[rustc_align(16)] //~ ERROR `#[rustc_align(...)]` is not supported on struct items
 struct S1;
diff --git a/tests/ui/attributes/malformed-fn-align.stderr b/tests/ui/attributes/malformed-fn-align.stderr
index b769d0b457d..c5986efaa34 100644
--- a/tests/ui/attributes/malformed-fn-align.stderr
+++ b/tests/ui/attributes/malformed-fn-align.stderr
@@ -1,63 +1,63 @@
-error[E0539]: malformed `align` attribute input
-  --> $DIR/malformed-fn-align.rs:5:5
+error[E0539]: malformed `rustc_align` attribute input
+  --> $DIR/malformed-fn-align.rs:10:5
    |
-LL |     #[align]
-   |     ^^^^^^^^
+LL |     #[rustc_align]
+   |     ^^^^^^^^^^^^^^
    |     |
    |     expected this to be a list
-   |     help: must be of the form: `#[align(<alignment in bytes>)]`
+   |     help: must be of the form: `#[rustc_align(<alignment in bytes>)]`
 
-error[E0805]: malformed `align` attribute input
-  --> $DIR/malformed-fn-align.rs:8:5
+error[E0805]: malformed `rustc_align` attribute input
+  --> $DIR/malformed-fn-align.rs:13:5
    |
-LL |     #[align(1, 2)]
-   |     ^^^^^^^------^
-   |     |      |
-   |     |      expected a single argument here
-   |     help: must be of the form: `#[align(<alignment in bytes>)]`
+LL |     #[rustc_align(1, 2)]
+   |     ^^^^^^^^^^^^^------^
+   |     |            |
+   |     |            expected a single argument here
+   |     help: must be of the form: `#[rustc_align(<alignment in bytes>)]`
 
-error[E0539]: malformed `align` attribute input
-  --> $DIR/malformed-fn-align.rs:12:1
+error[E0539]: malformed `rustc_align` attribute input
+  --> $DIR/malformed-fn-align.rs:17:1
    |
-LL | #[align = 16]
-   | ^^^^^^^^^^^^^
+LL | #[rustc_align = 16]
+   | ^^^^^^^^^^^^^^^^^^^
    | |
    | expected this to be a list
-   | help: must be of the form: `#[align(<alignment in bytes>)]`
+   | help: must be of the form: `#[rustc_align(<alignment in bytes>)]`
 
 error[E0589]: invalid alignment value: not an unsuffixed integer
-  --> $DIR/malformed-fn-align.rs:15:9
+  --> $DIR/malformed-fn-align.rs:20:15
    |
-LL | #[align("hello")]
-   |         ^^^^^^^
+LL | #[rustc_align("hello")]
+   |               ^^^^^^^
 
 error[E0589]: invalid alignment value: not a power of two
-  --> $DIR/malformed-fn-align.rs:18:9
+  --> $DIR/malformed-fn-align.rs:23:15
    |
-LL | #[align(0)]
-   |         ^
+LL | #[rustc_align(0)]
+   |               ^
 
 error: `#[repr(align(...))]` is not supported on function items
-  --> $DIR/malformed-fn-align.rs:21:8
+  --> $DIR/malformed-fn-align.rs:26:8
    |
 LL | #[repr(align(16))]
    |        ^^^^^^^^^
    |
-help: use `#[align(...)]` instead
-  --> $DIR/malformed-fn-align.rs:21:8
+help: use `#[rustc_align(...)]` instead
+  --> $DIR/malformed-fn-align.rs:26:8
    |
 LL | #[repr(align(16))]
    |        ^^^^^^^^^
 
-error: `#[align(...)]` is not supported on struct items
-  --> $DIR/malformed-fn-align.rs:24:1
+error: `#[rustc_align(...)]` is not supported on struct items
+  --> $DIR/malformed-fn-align.rs:29:1
    |
-LL | #[align(16)]
-   | ^^^^^^^^^^^^
+LL | #[rustc_align(16)]
+   | ^^^^^^^^^^^^^^^^^^
    |
 help: use `#[repr(align(...))]` instead
    |
-LL - #[align(16)]
+LL - #[rustc_align(16)]
 LL + #[repr(align(16))]
    |
 
diff --git a/tests/ui/feature-gates/feature-gate-fn_align.rs b/tests/ui/feature-gates/feature-gate-fn_align.rs
index b6c300e5cbe..36e17c4a8dd 100644
--- a/tests/ui/feature-gates/feature-gate-fn_align.rs
+++ b/tests/ui/feature-gates/feature-gate-fn_align.rs
@@ -1,12 +1,16 @@
 #![crate_type = "lib"]
 
-#[align(16)]
-//~^ ERROR the `#[align]` attribute is an experimental feature
+// ignore-tidy-linelength
+
+// FIXME(#82232, #143834): temporarily renamed to mitigate `#[align]` nameres ambiguity
+
+#[rustc_align(16)]
+//~^ ERROR the `#[rustc_align]` attribute is an experimental feature
 fn requires_alignment() {}
 
 trait MyTrait {
-    #[align]
-    //~^ ERROR the `#[align]` attribute is an experimental feature
-    //~| ERROR malformed `align` attribute input
+    #[rustc_align]
+    //~^ ERROR the `#[rustc_align]` attribute is an experimental feature
+    //~| ERROR malformed `rustc_align` attribute input
     fn myfun();
 }
diff --git a/tests/ui/feature-gates/feature-gate-fn_align.stderr b/tests/ui/feature-gates/feature-gate-fn_align.stderr
index 921cf08435c..6196f4f298f 100644
--- a/tests/ui/feature-gates/feature-gate-fn_align.stderr
+++ b/tests/ui/feature-gates/feature-gate-fn_align.stderr
@@ -1,31 +1,31 @@
-error[E0658]: the `#[align]` attribute is an experimental feature
-  --> $DIR/feature-gate-fn_align.rs:3:1
+error[E0658]: the `#[rustc_align]` attribute is an experimental feature
+  --> $DIR/feature-gate-fn_align.rs:7:1
    |
-LL | #[align(16)]
-   | ^^^^^^^^^^^^
+LL | #[rustc_align(16)]
+   | ^^^^^^^^^^^^^^^^^^
    |
    = note: see issue #82232 <https://github.com/rust-lang/rust/issues/82232> for more information
    = help: add `#![feature(fn_align)]` to the crate attributes to enable
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
-error[E0658]: the `#[align]` attribute is an experimental feature
-  --> $DIR/feature-gate-fn_align.rs:8:5
+error[E0658]: the `#[rustc_align]` attribute is an experimental feature
+  --> $DIR/feature-gate-fn_align.rs:12:5
    |
-LL |     #[align]
-   |     ^^^^^^^^
+LL |     #[rustc_align]
+   |     ^^^^^^^^^^^^^^
    |
    = note: see issue #82232 <https://github.com/rust-lang/rust/issues/82232> for more information
    = help: add `#![feature(fn_align)]` to the crate attributes to enable
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
-error[E0539]: malformed `align` attribute input
-  --> $DIR/feature-gate-fn_align.rs:8:5
+error[E0539]: malformed `rustc_align` attribute input
+  --> $DIR/feature-gate-fn_align.rs:12:5
    |
-LL |     #[align]
-   |     ^^^^^^^^
+LL |     #[rustc_align]
+   |     ^^^^^^^^^^^^^^
    |     |
    |     expected this to be a list
-   |     help: must be of the form: `#[align(<alignment in bytes>)]`
+   |     help: must be of the form: `#[rustc_align(<alignment in bytes>)]`
 
 error: aborting due to 3 previous errors