-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tracking Issue for #[repr(align(...))]
on function items (fn_align)
#82232
Comments
#[repr(align = ...)]
on function items (fn_align)#[repr(align(...))]
on function items (fn_align)
Is it be possible to apply this to methods as well? #![feature(fn_align)]
#[repr(align(1))]
fn main() {
Bar::foo();
}
struct Bar;
impl Bar {
#[repr(align(1))]
fn foo() {
println!("bar");
}
}
|
I don't see why not? (I'm surprised it doesn't work already honestly lol) I'll see if I can find some time to investigate that and make another PR to allow that 👍 |
MessageMf has "Many fields" making it able to see how borrowed and owned scale differently. Added benchmarking creating default instances of Message and MessageMf. Removed the xxx_loop() variants as they don't add information just more noise. I would like to look at why xxx_idx_loop() is sometimes slower than xxx_iter_loop(). NOTE: I believe some of the noise is caused by code alignment changes as we tweak that where doing and change code. See: https://www.google.com/search?q=benchmark+sensitive+to+code+alignment and rust-lang/rust#82232
Thanks for opening this, I just bumped my head into this exact problem as well! |
…d, r=WaffleLapkin allow `repr(align = x)` on inherent methods Discussion: rust-lang#82232 (comment)
This should come with a command-line flag to address the request made in #128830 for global code alignment control. |
…tions, r=workingjubilee,compiler-errors add repr to the allowlist for naked functions Fixes rust-lang#129412 (combining unstable features rust-lang#90957 (`#![feature(naked_functions)]`) and rust-lang#82232 (`#![feature(fn_align)]`)
Rollup merge of rust-lang#129421 - jdonszelmann:naked-repr-align-functions, r=workingjubilee,compiler-errors add repr to the allowlist for naked functions Fixes rust-lang#129412 (combining unstable features rust-lang#90957 (`#![feature(naked_functions)]`) and rust-lang#82232 (`#![feature(fn_align)]`)
This feature allows specifying an alignment for function items by adding the
#[repr(align(...))]
attribute to them.The feature gate for the issue is
#![feature(fn_align)]
Example
Steps
The text was updated successfully, but these errors were encountered: