Skip to content

Commit

Permalink
Rollup merge of #97851 - saethlin:use-repr-c, r=thomcc
Browse files Browse the repository at this point in the history
Use repr(C) when depending on struct layout in ptr tests

The test depends on the layout of this struct `Pair`, so it should use `repr(C)` instead of the default `repr(Rust)`.
  • Loading branch information
Dylan-DPC authored Jun 8, 2022
2 parents a90c5a3 + 5dd5244 commit 1660b4b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions library/core/tests/ptr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ fn test_const_from_raw_parts() {
#[test]
fn test() {
unsafe {
#[repr(C)]
struct Pair {
fst: isize,
snd: isize,
Expand Down

0 comments on commit 1660b4b

Please sign in to comment.