Skip to content

Commit d2e3c00

Browse files
committed
Auto merge of #146409 - matthiaskrgr:rollup-thju381, r=matthiaskrgr
Rollup of 5 pull requests Successful merges: - rust-lang/rust#144765 (inclusive `Range`s: change `end` to `last`) - rust-lang/rust#146178 (Implement `#[rustc_align_static(N)]` on `static`s) - rust-lang/rust#146368 (CI: rfl: move job forward to Linux v6.17-rc5 to remove temporary commits) - rust-lang/rust#146378 (Update wasm-component-ld to 0.5.17) - rust-lang/rust#146391 (Trim paths less in MIR dumping) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 74ec2bf + 6840536 commit d2e3c00

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tests/pass/static_align.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#![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

Comments
 (0)