Skip to content

Commit 3aad93e

Browse files
committed
stabilize align(N) on function items
1 parent 6d0c9e2 commit 3aad93e

File tree

16 files changed

+19
-71
lines changed

16 files changed

+19
-71
lines changed

compiler/rustc_feature/src/accepted.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,8 @@ declare_features! (
216216
(accepted, f16c_target_feature, "1.68.0", Some(44839)),
217217
/// Allows field shorthands (`x` meaning `x: x`) in struct literal expressions.
218218
(accepted, field_init_shorthand, "1.17.0", Some(37340)),
219+
/// Allows using `#[align(...)]` on function items
220+
(accepted, fn_align, "CURRENT_RUSTC_VERSION", Some(82232)),
219221
/// Allows `#[must_use]` on functions, and introduces must-use operators (RFC 1940).
220222
(accepted, fn_must_use, "1.27.0", Some(43302)),
221223
/// Allows capturing variables in scope using format_args!

compiler/rustc_feature/src/builtin_attrs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ pub static BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
495495
),
496496
ungated!(no_link, Normal, template!(Word), WarnFollowing, EncodeCrossCrate::No),
497497
ungated!(repr, Normal, template!(List: "C"), DuplicatesOk, EncodeCrossCrate::No),
498-
gated!(align, Normal, template!(List: "alignment"), DuplicatesOk, EncodeCrossCrate::No, fn_align, experimental!(align)),
498+
ungated!(align, Normal, template!(List: "alignment"), DuplicatesOk, EncodeCrossCrate::No),
499499
ungated!(unsafe(Edition2024) export_name, Normal, template!(NameValueStr: "name"), FutureWarnPreceding, EncodeCrossCrate::No),
500500
ungated!(unsafe(Edition2024) link_section, Normal, template!(NameValueStr: "name"), FutureWarnPreceding, EncodeCrossCrate::No),
501501
ungated!(unsafe(Edition2024) no_mangle, Normal, template!(Word), WarnFollowing, EncodeCrossCrate::No),

compiler/rustc_feature/src/unstable.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -510,8 +510,6 @@ declare_features! (
510510
(unstable, ffi_pure, "1.45.0", Some(58329)),
511511
/// Controlling the behavior of fmt::Debug
512512
(unstable, fmt_debug, "1.82.0", Some(129709)),
513-
/// Allows using `#[align(...)]` on function items
514-
(unstable, fn_align, "1.53.0", Some(82232)),
515513
/// Support delegating implementation of functions to other already implemented functions.
516514
(incomplete, fn_delegation, "1.76.0", Some(118212)),
517515
/// Allows impls for the Freeze trait.

src/tools/miri/tests/pass/fn_align.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//@compile-flags: -Zmin-function-alignment=8
2-
#![feature(fn_align)]
32

43
// When a function uses `align(N)`, the function address should be a multiple of `N`.
54

tests/assembly/naked-functions/aix.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
//@[aix] needs-llvm-components: powerpc
1010

1111
#![crate_type = "lib"]
12-
#![feature(no_core, asm_experimental_arch, f128, linkage, fn_align)]
12+
#![feature(no_core, asm_experimental_arch, f128, linkage)]
1313
#![no_core]
1414

1515
// tests that naked functions work for the `powerpc64-ibm-aix` target.

tests/assembly/naked-functions/wasm32.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
//@ [wasm32-wasip1] needs-llvm-components: webassembly
1010

1111
#![crate_type = "lib"]
12-
#![feature(no_core, asm_experimental_arch, f128, linkage, fn_align)]
12+
#![feature(no_core, asm_experimental_arch, f128, linkage)]
1313
#![no_core]
1414

1515
extern crate minicore;

tests/codegen/align-fn.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
//@ compile-flags: -C no-prepopulate-passes -Z mir-opt-level=0
22

33
#![crate_type = "lib"]
4-
#![feature(fn_align)]
54

65
// CHECK: align 16
76
#[no_mangle]

tests/codegen/min-function-alignment.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
//@ [align1024] compile-flags: -Zmin-function-alignment=1024
55

66
#![crate_type = "lib"]
7-
#![feature(fn_align)]
87

98
// functions without explicit alignment use the global minimum
109
//

tests/codegen/naked-fn/aligned.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
//@ ignore-arm no "ret" mnemonic
44

55
#![crate_type = "lib"]
6-
#![feature(fn_align)]
76
use std::arch::naked_asm;
87

98
// CHECK: .balign 16

tests/codegen/naked-fn/min-function-alignment.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
//@ needs-asm-support
33
//@ ignore-arm no "ret" mnemonic
44

5-
#![feature(fn_align)]
65
#![crate_type = "lib"]
76

87
// functions without explicit alignment use the global minimum

0 commit comments

Comments
 (0)