-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Align attr fixes #143206
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
base: master
Are you sure you want to change the base?
Align attr fixes #143206
Conversation
rustbot has assigned @WaffleLapkin. Use |
Some changes occurred in compiler/rustc_passes/src/check_attr.rs Some changes occurred in compiler/rustc_codegen_ssa Some changes occurred in compiler/rustc_codegen_ssa/src/codegen_attrs.rs |
|
☔ The latest upstream changes (presumably #143267) made this pull request unmergeable. Please resolve the merge conflicts. |
This requires rebase. |
@rustbot author |
Reminder, once the PR becomes ready for a review, use |
91791f5
to
0382357
Compare
@rustbot ready |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is good as-is but I would like to see more tests. You can add them now or as a followup PR or open an issue instead. r=me either way.
#[align(32)] | ||
#[align(256)] | ||
extern "C" fn align_unmangled() {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Weren't we going to warn on applying align
twice?
I mean that shouldn't affect the codegen test, I'm just realizing that I don't know for sure if we have a test that does check that we warn.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice to have a warning, but it’s not required for the MVP. It hasn’t been implemented yet.
#![feature(fn_align)] | ||
|
||
trait Test { | ||
#[align(4096)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
4096 is pretty big but I am realizing I don't see a test for oversized aligns that we should definitely reject, I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
4096 I believe is the highest align that should work more or less everywhere. Because this test relies on converting to a function pointer, choosing a high value minimizes the chance of “getting lucky”.
Rejecting high alignments on platforms that don’t support them is being worked on by others, I think.
@bors delegate+ |
✌️ @Jules-Bertholet, you can now approve this pull request! If @workingjubilee told you to " |
It's also possible that the tests already exist and I was just too ferrisClueless.jpg to find them |
2e6c84a
to
440bf29
Compare
…r=workingjubilee Align attr fixes - Remove references to the superseded `repr(align)` syntax - Allow the attribute on fn items in `extern` blocks - Test attribute in combination with `async fn` and `dyn` r? workingjubilee `@rustbot` label A-attributes F-fn_align T-compiler
Rollup of 12 pull requests Successful merges: - #141829 (Specialize sleep_until implementation for unix (except mac)) - #141847 (Explain `TOCTOU` on the top of `std::fs`, and reference it in functions) - #142138 (Add `Vec::into_chunks`) - #142321 (Expose elf abi on ppc64 targets) - #142568 (Use the .drectve section for exporting symbols from dlls on Windows) - #142886 (ci: aarch64-gnu: Stop skipping `panic_abort_doc_tests`) - #143038 (avoid suggesting traits from private dependencies) - #143194 (fix bitcast of single-element SIMD vectors) - #143206 (Align attr fixes) - #143258 (Don't recompute `DisambiguatorState` for every RPITIT in trait definition) - #143260 (Use the correct export kind for __rust_alloc_error_handler_should_panic) - #143274 (ci: support optional jobs) r? `@ghost` `@rustbot` modify labels: rollup
…r=workingjubilee Align attr fixes - Remove references to the superseded `repr(align)` syntax - Allow the attribute on fn items in `extern` blocks - Test attribute in combination with `async fn` and `dyn` r? workingjubilee ``@rustbot`` label A-attributes F-fn_align T-compiler
repr(align)
syntaxextern
blocksasync fn
anddyn
r? workingjubilee
@rustbot label A-attributes F-fn_align T-compiler