about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorTrevor Gross <t.gross35@gmail.com>2025-06-18 20:22:49 -0400
committerGitHub <noreply@github.com>2025-06-18 20:22:49 -0400
commit07932ad11153b62ec2138fa71a398a1ca8ea05ac (patch)
tree289f0c510ce9d472d6c5e29424f3174fe7ac71b9 /src
parentcff8e9ae142c3dcaf4c66ec5b6be932f1442c4b5 (diff)
parent1fdf2b562070ec98c5b32ee67b8c6d8145127a6e (diff)
downloadrust-07932ad11153b62ec2138fa71a398a1ca8ea05ac.tar.gz
rust-07932ad11153b62ec2138fa71a398a1ca8ea05ac.zip
Rollup merge of #142507 - folkertdev:fn-align-align-attribute, r=jdonszelmann
use `#[align]` attribute for `fn_align`

Tracking issue: https://github.com/rust-lang/rust/issues/82232

https://github.com/rust-lang/rfcs/pull/3806 decides to add the `#[align]` attribute for alignment of various items. Right now it's used for functions with `fn_align`, in the future it will get more uses (statics, struct fields, etc.)

(the RFC finishes FCP today)

r? `@ghost`
Diffstat (limited to 'src')
-rw-r--r--src/tools/miri/tests/pass/fn_align.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/tools/miri/tests/pass/fn_align.rs b/src/tools/miri/tests/pass/fn_align.rs
index 550bb1cb4d7..28f92995880 100644
--- a/src/tools/miri/tests/pass/fn_align.rs
+++ b/src/tools/miri/tests/pass/fn_align.rs
@@ -1,21 +1,21 @@
 //@compile-flags: -Zmin-function-alignment=8
 #![feature(fn_align)]
 
-// When a function uses `repr(align(N))`, the function address should be a multiple of `N`.
+// When a function uses `align(N)`, the function address should be a multiple of `N`.
 
-#[repr(align(256))]
+#[align(256)]
 fn foo() {}
 
-#[repr(align(16))]
+#[align(16)]
 fn bar() {}
 
-#[repr(align(4))]
+#[align(4)]
 fn baz() {}
 
 fn main() {
     assert!((foo as usize).is_multiple_of(256));
     assert!((bar as usize).is_multiple_of(16));
 
-    // The maximum of `repr(align(N))` and `-Zmin-function-alignment=N` is used.
+    // The maximum of `align(N)` and `-Zmin-function-alignment=N` is used.
     assert!((baz as usize).is_multiple_of(8));
 }