Use #[repr(C)] on debuginfo test structs - #162364
Merged
Merged
Conversation
Collaborator
|
|
jieyouxu
approved these changes
Sep 6, 2026
Member
Contributor
|
✌️ @Walnut356, you can now approve this pull request! If @jieyouxu told you to " |
This comment has been minimized.
This comment has been minimized.
rust-bors Bot
pushed a commit
that referenced
this pull request
Sep 6, 2026
Use `#[repr(C)]` on debuginfo test structs
Contributor
Member
|
@bors r+ |
Contributor
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Sep 6, 2026
Use `#[repr(C)]` on debuginfo test structs This fixes a couple of issues. * LLDB reading PDB debug info re-orders fields and displays them in offset order instead of source-order like DWARF. While this has been [fixed upstream](llvm/llvm-project#218731), it'll be quite a while before it's reflected in CI runners and such * For all targets, the structs were often written (and named) under the assumption that they would have specific layouts. Nothing was actually enforcing those assumed layouts, so very often a type would be named e.g. `HasInternalPadding` but rust would reorder it such that no internal padding existed. `struct-with-destructor.rs` is still iffy. I'll test it when I get home and can update my main PC's LLDB. On my remote PC (lldb 22.1.2) it didn't fix the test, and it looked like the variable was straight up being read incorrectly: ``` // expected: (struct_with_destructor::NestedOuter) nested = {a:{a:{x:7890, y:9870}}} // got: (struct_with_destructor::NestedOuter) nested = {a:{a:{y:1378684509906, x:9870}} ``` On my laptop when manually inspecting it (CodeLLDB which uses 22.1.8 under the hood) everything looked fine, so it might have been a bug that LLDB patched. Part of the MSVC test fixes for rust-lang#161657 r? @Kobzol, @jieyouxu --- test-jobs: aarch64-apple-1 test-jobs: aarch64-msvc-1 test-jobs: x86_64-msvc-1 test-jobs: x86_64-mingw-1
rust-bors Bot
pushed a commit
that referenced
this pull request
Sep 6, 2026
…uwer Rollup of 5 pull requests Successful merges: - #159541 (Use query for Variant InhabitedPredicate) - #162364 (Use `#[repr(C)]` on debuginfo test structs) - #162215 (remove stale/duplicate tests) - #162335 (Add several new LLDB feature flags) - #162341 (add regression test for packus_epi16 issue)
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Sep 6, 2026
Use `#[repr(C)]` on debuginfo test structs This fixes a couple of issues. * LLDB reading PDB debug info re-orders fields and displays them in offset order instead of source-order like DWARF. While this has been [fixed upstream](llvm/llvm-project#218731), it'll be quite a while before it's reflected in CI runners and such * For all targets, the structs were often written (and named) under the assumption that they would have specific layouts. Nothing was actually enforcing those assumed layouts, so very often a type would be named e.g. `HasInternalPadding` but rust would reorder it such that no internal padding existed. `struct-with-destructor.rs` is still iffy. I'll test it when I get home and can update my main PC's LLDB. On my remote PC (lldb 22.1.2) it didn't fix the test, and it looked like the variable was straight up being read incorrectly: ``` // expected: (struct_with_destructor::NestedOuter) nested = {a:{a:{x:7890, y:9870}}} // got: (struct_with_destructor::NestedOuter) nested = {a:{a:{y:1378684509906, x:9870}} ``` On my laptop when manually inspecting it (CodeLLDB which uses 22.1.8 under the hood) everything looked fine, so it might have been a bug that LLDB patched. Part of the MSVC test fixes for rust-lang#161657 r? @Kobzol, @jieyouxu --- test-jobs: aarch64-apple-1 test-jobs: aarch64-msvc-1 test-jobs: x86_64-msvc-1 test-jobs: x86_64-mingw-1
rust-bors Bot
pushed a commit
that referenced
this pull request
Sep 6, 2026
…uwer Rollup of 7 pull requests Successful merges: - #162358 (Force u8/i8 numeric formatting on LLDB) - #162359 (Use `lldb.eTypeOptionHideChildren` for msvc tuples) - #162364 (Use `#[repr(C)]` on debuginfo test structs) - #162215 (remove stale/duplicate tests) - #162335 (Add several new LLDB feature flags) - #162341 (add regression test for packus_epi16 issue) - #162374 (Make `VaArgSafe` dyn-incompatible)
Member
|
@bors try jobs=x86_64-mingw-1,x86_64-msvc-1 |
Contributor
|
⌛ Trying commit 81fcec3 with merge 115f425… To cancel the try build, run the command Workflow: https://github.com/rust-lang/rust/actions/runs/34051488529 |
rust-bors Bot
pushed a commit
that referenced
this pull request
Sep 6, 2026
Use `#[repr(C)]` on debuginfo test structs try-job: x86_64-mingw-1 try-job: x86_64-msvc-1
Member
|
@bors try cancel |
Contributor
|
Try build cancelled. Cancelled workflows: Hint: if you want to run another try build, you do not need to manually cancel the previous one. Just run |
rust-bors Bot
pushed a commit
that referenced
this pull request
Sep 6, 2026
…uwer Rollup of 5 pull requests Successful merges: - #162358 (Force u8/i8 numeric formatting on LLDB) - #162359 (Use `lldb.eTypeOptionHideChildren` for msvc tuples) - #162364 (Use `#[repr(C)]` on debuginfo test structs) - #162215 (remove stale/duplicate tests) - #162335 (Add several new LLDB feature flags)
rust-bors Bot
pushed a commit
that referenced
this pull request
Sep 6, 2026
Rollup merge of #162364 - Walnut356:debuginfo_repr, r=jieyouxu Use `#[repr(C)]` on debuginfo test structs This fixes a couple of issues. * LLDB reading PDB debug info re-orders fields and displays them in offset order instead of source-order like DWARF. While this has been [fixed upstream](llvm/llvm-project#218731), it'll be quite a while before it's reflected in CI runners and such * For all targets, the structs were often written (and named) under the assumption that they would have specific layouts. Nothing was actually enforcing those assumed layouts, so very often a type would be named e.g. `HasInternalPadding` but rust would reorder it such that no internal padding existed. `struct-with-destructor.rs` is still iffy. I'll test it when I get home and can update my main PC's LLDB. On my remote PC (lldb 22.1.2) it didn't fix the test, and it looked like the variable was straight up being read incorrectly: ``` // expected: (struct_with_destructor::NestedOuter) nested = {a:{a:{x:7890, y:9870}}} // got: (struct_with_destructor::NestedOuter) nested = {a:{a:{y:1378684509906, x:9870}} ``` On my laptop when manually inspecting it (CodeLLDB which uses 22.1.8 under the hood) everything looked fine, so it might have been a bug that LLDB patched. Part of the MSVC test fixes for #161657 r? @Kobzol, @jieyouxu --- test-jobs: aarch64-apple-1 test-jobs: aarch64-msvc-1 test-jobs: x86_64-msvc-1 test-jobs: x86_64-mingw-1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fixes a couple of issues.
HasInternalPaddingbut rust would reorder it such that no internal padding existed.struct-with-destructor.rsis still iffy. I'll test it when I get home and can update my main PC's LLDB.On my remote PC (lldb 22.1.2) it didn't fix the test, and it looked like the variable was straight up being read incorrectly:
On my laptop when manually inspecting it (CodeLLDB which uses 22.1.8 under the hood) everything looked fine, so it might have been a bug that LLDB patched.
Part of the MSVC test fixes for #161657
r? @Kobzol, @jieyouxu
test-jobs: aarch64-apple-1
test-jobs: aarch64-msvc-1
test-jobs: x86_64-msvc-1
test-jobs: x86_64-mingw-1