We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 891fbf7 + 9ead6d5 commit 6f1f392Copy full SHA for 6f1f392
rust-version
@@ -1 +1 @@
1
-a09fbe2c8372643a27a8082236120f95ed4e6bba
+f4665ab8368ad2e8a86d4390ae35c28bdd9561bb
tests/pass/static_align.rs
@@ -0,0 +1,14 @@
+#![feature(static_align)]
2
+
3
+// When a static uses `align(N)`, its address should be a multiple of `N`.
4
5
+#[rustc_align_static(256)]
6
+static FOO: u64 = 0;
7
8
+#[rustc_align_static(512)]
9
+static BAR: u64 = 0;
10
11
+fn main() {
12
+ assert!(core::ptr::from_ref(&FOO).addr().is_multiple_of(256));
13
+ assert!(core::ptr::from_ref(&BAR).addr().is_multiple_of(512));
14
+}
0 commit comments