Files
rust/tests/ui/attributes/fn-align-dyn.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

21 lines
514 B
Rust
Raw Normal View History

2025-06-29 14:33:51 -04:00
//@ run-pass
2025-07-06 18:10:52 -04:00
//@ ignore-wasm32 aligning functions is not currently supported on wasm (#143368)
//@ ignore-backends: gcc
// FIXME(#82232, #143834): temporarily renamed to mitigate `#[align]` nameres ambiguity
#![feature(rustc_attrs)]
2025-06-29 14:33:51 -04:00
#![feature(fn_align)]
trait Test {
#[rustc_align(4096)]
2025-06-29 14:33:51 -04:00
fn foo(&self);
#[rustc_align(4096)]
2025-06-29 14:33:51 -04:00
fn foo1(&self);
}
fn main() {
assert_eq!((<dyn Test>::foo as fn(_) as usize & !1) % 4096, 0);
assert_eq!((<dyn Test>::foo1 as fn(_) as usize & !1) % 4096, 0);
}