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 |
workingjubilee
left a comment
There was a problem hiding this comment.
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.
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.
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.
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.
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
Yes. My thinking is that LLVM could fill the table with dummy entries in order to align things. |
|
It's completely silly to "align" things in that table, though... isn't it? |
|
If you are doing function pointer tagging, it might be necessary. But yes, the usefulness is limited. |
|
So, should we just apply a target-specific minimum of |
|
We should definitely have an issue for this rather than discussing this in a PR, so I made one: #143368. |
|
For this PR I think we can just mark the test as skipped for wasm with a link to the issue. (I also added a link to the tracking issue, those are super useful when figuring out how a feature changed...) |
|
Looks like this has already mostly been answered, but can confirm:
This is correct, function pointers in wasm are table indices (e.g. 1, 2, 3, ...). The table index 0 is skipped to provide the guarantee that function pointers are never 0/null (also that 0/null is an invalid function pointer) |
|
☔ The latest upstream changes (presumably #143526) made this pull request unmergeable. Please resolve the merge conflicts. |
440bf29 to
196e3ed
Compare
1995282 to
8f86c4a
Compare
|
@bors r+ |
Rollup of 9 pull requests Successful merges: - #143206 (Align attr fixes) - #143236 (Stabilize `mixed_integer_ops_unsigned_sub`) - #143344 (Port `#[path]` to the new attribute parsing infrastructure ) - #143359 (Link to 2024 edition page for `!` fallback changes) - #143456 (mbe: Change `unused_macro_rules` to a `DenseBitSet`) - #143529 (Renamed retain_mut to retain on LinkedList as mentioned in the ACP) - #143535 (Remove duplicate word) - #143544 (compiler: rename BareFn to FnPtr) - #143552 (lib: more eagerly return `self.len()` from `ceil_char_boundary`) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of #143206 - Jules-Bertholet:align-attr-fixes, 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 Tracking issue: #82232 `@rustbot` label A-attributes F-fn_align T-compiler
Rollup of 9 pull requests Successful merges: - rust-lang/rust#143206 (Align attr fixes) - rust-lang/rust#143236 (Stabilize `mixed_integer_ops_unsigned_sub`) - rust-lang/rust#143344 (Port `#[path]` to the new attribute parsing infrastructure ) - rust-lang/rust#143359 (Link to 2024 edition page for `!` fallback changes) - rust-lang/rust#143456 (mbe: Change `unused_macro_rules` to a `DenseBitSet`) - rust-lang/rust#143529 (Renamed retain_mut to retain on LinkedList as mentioned in the ACP) - rust-lang/rust#143535 (Remove duplicate word) - rust-lang/rust#143544 (compiler: rename BareFn to FnPtr) - rust-lang/rust#143552 (lib: more eagerly return `self.len()` from `ceil_char_boundary`) r? `@ghost` `@rustbot` modify labels: rollup
Rollup of 9 pull requests Successful merges: - rust-lang#143206 (Align attr fixes) - rust-lang#143236 (Stabilize `mixed_integer_ops_unsigned_sub`) - rust-lang#143344 (Port `#[path]` to the new attribute parsing infrastructure ) - rust-lang#143359 (Link to 2024 edition page for `!` fallback changes) - rust-lang#143456 (mbe: Change `unused_macro_rules` to a `DenseBitSet`) - rust-lang#143529 (Renamed retain_mut to retain on LinkedList as mentioned in the ACP) - rust-lang#143535 (Remove duplicate word) - rust-lang#143544 (compiler: rename BareFn to FnPtr) - rust-lang#143552 (lib: more eagerly return `self.len()` from `ceil_char_boundary`) r? `@ghost` `@rustbot` modify labels: rollup
repr(align)syntaxexternblocksasync fnanddynr? workingjubilee
Tracking issue: #82232
@rustbot label A-attributes F-fn_align T-compiler