Repository navigation
Conversation
This comment has been minimized.
This comment has been minimized.
329f4c1 to
90d6dd8
Compare
So this is basically fixing a bug in #156112. @Jules-Bertholet does this look reasonable? @beetrees could you add a test for the case that was buggy? |
Which ones?
Yes. It's not clear to me what this fixes in practice, but this PR's logic is a lot more clear/consistent/future-proof than my version, which is reason enough to merge it. |
90d6dd8 to
cc109c8
Compare
#164628 is fixing the 64-bit MIPS ABI. The ABI treats
I've added a |
|
OK, so this doesn't fix any ABI bugs directly, but it's a necessary prerequisite to the fixes in #164628. That makes sense, thanks 👍 |
cc109c8 to
35832da
Compare
35832da to
697baa3
Compare
697baa3 to
3cb376f
Compare
This comment has been minimized.
This comment has been minimized.
3cb376f to
20965a7
Compare
This comment has been minimized.
This comment has been minimized.
|
|
|
It would probably be good to have a codegen-llvm test for whatever ABI this actually affects. |
20965a7 to
c4e8191
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
Yes @bors r+ |
…=bjorn3 Fix considering `[u8; 0]` to have trivial ABI in layout The ABI layout handling of trivial ABI currently only checks that the type is a 1-ZST and doesn't contain any `repr(C)` types: however the documentation for trivial ABIs states that any array with a non-trivial element type is itself non-trivial. This means that the current ABI code considers types like `[u8; 0]` to be trivial even though they are not - this PR fixes it to match the documentation. This isn't particularly important for arguments/returns as C doesn't allow plain arrays in the argument/return positions, but it is important in other places. Found by @chenx97 in rust-lang#164628. Split out from rust-lang#166170. r? @bjorn3
…=bjorn3 Fix considering `[u8; 0]` to have trivial ABI in layout The ABI layout handling of trivial ABI currently only checks that the type is a 1-ZST and doesn't contain any `repr(C)` types: however the documentation for trivial ABIs states that any array with a non-trivial element type is itself non-trivial. This means that the current ABI code considers types like `[u8; 0]` to be trivial even though they are not - this PR fixes it to match the documentation. This isn't particularly important for arguments/returns as C doesn't allow plain arrays in the argument/return positions, but it is important in other places. Found by @chenx97 in rust-lang#164628. Split out from rust-lang#166170. r? @bjorn3
…uwer Rollup of 5 pull requests Successful merges: - #166232 (Fix considering `[u8; 0]` to have trivial ABI in layout) - #166663 (optimize `ArrayWindows::nth`) - #166693 (Make function signatures a separate type in `rustc_codegen_llvm`) - #166699 (rustc_serialize: Remove unnecessary lifetime from `FileEncoder`) - #166665 (Mention alignment in handle_alloc_error)
Fix considering `[u8; 0]` to have trivial ABI in layout The ABI layout handling of trivial ABI currently only checks that the type is a 1-ZST and doesn't contain any `repr(C)` types: however the documentation for trivial ABIs states that any array with a non-trivial element type is itself non-trivial. This means that the current ABI code considers types like `[u8; 0]` to be trivial even though they are not - this PR fixes it to match the documentation. This isn't particularly important for arguments/returns as C doesn't allow plain arrays in the argument/return positions, but it is important in other places. Found by @chenx97 in #164628. Split out from #166170. r? @bjorn3
…=bjorn3 Fix considering `[u8; 0]` to have trivial ABI in layout The ABI layout handling of trivial ABI currently only checks that the type is a 1-ZST and doesn't contain any `repr(C)` types: however the documentation for trivial ABIs states that any array with a non-trivial element type is itself non-trivial. This means that the current ABI code considers types like `[u8; 0]` to be trivial even though they are not - this PR fixes it to match the documentation. This isn't particularly important for arguments/returns as C doesn't allow plain arrays in the argument/return positions, but it is important in other places. Found by @chenx97 in rust-lang#164628. Split out from rust-lang#166170. r? @bjorn3
|
@bors yield |
|
Auto build was cancelled. Cancelled workflows: The next pull request likely to be tested is #166709. |
…uwer Rollup of 5 pull requests Successful merges: - #166232 (Fix considering `[u8; 0]` to have trivial ABI in layout) - #166663 (optimize `ArrayWindows::nth`) - #166693 (Make function signatures a separate type in `rustc_codegen_llvm`) - #166699 (rustc_serialize: Remove unnecessary lifetime from `FileEncoder`) - #166366 (Add tests to check we don't confuse LLVM and builtin intrinsics.)
Fix considering `[u8; 0]` to have trivial ABI in layout The ABI layout handling of trivial ABI currently only checks that the type is a 1-ZST and doesn't contain any `repr(C)` types: however the documentation for trivial ABIs states that any array with a non-trivial element type is itself non-trivial. This means that the current ABI code considers types like `[u8; 0]` to be trivial even though they are not - this PR fixes it to match the documentation. This isn't particularly important for arguments/returns as C doesn't allow plain arrays in the argument/return positions, but it is important in other places. Found by @chenx97 in #164628. Split out from #166170. r? @bjorn3
|
@bors yield |
|
Auto build was cancelled. Cancelled workflows: The next pull request likely to be tested is #166709. |
…uwer Rollup of 5 pull requests Successful merges: - #166232 (Fix considering `[u8; 0]` to have trivial ABI in layout) - #166663 (optimize `ArrayWindows::nth`) - #166693 (Make function signatures a separate type in `rustc_codegen_llvm`) - #166699 (rustc_serialize: Remove unnecessary lifetime from `FileEncoder`) - #166366 (Add tests to check we don't confuse LLVM and builtin intrinsics.)
View all comments
The ABI layout handling of trivial ABI currently only checks that the type is a 1-ZST and doesn't contain any
repr(C)types: however the documentation for trivial ABIs states that any array with a non-trivial element type is itself non-trivial. This means that the current ABI code considers types like[u8; 0]to be trivial even though they are not - this PR fixes it to match the documentation. This isn't particularly important for arguments/returns as C doesn't allow plain arrays in the argument/return positions, but it is important in other places. Found by @chenx97 in #164628. Split out from #166170.r? @bjorn3