Skip to content

Commit e262305

Browse files
onalante-msftemilio
authored andcommitted
Extract pointer once for all alignment tests
1 parent 17b01c7 commit e262305

File tree

243 files changed

+1323
-3465
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

243 files changed

+1323
-3465
lines changed

src/codegen/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2190,7 +2190,6 @@ impl CodeGenerator for CompInfo {
21902190
quote! {
21912191
assert_eq!(
21922192
unsafe {
2193-
let ptr = UNINIT.as_ptr();
21942193
::#prefix::ptr::addr_of!((*ptr).#field_name) as usize - ptr as usize
21952194
},
21962195
#field_offset,
@@ -2208,6 +2207,7 @@ impl CodeGenerator for CompInfo {
22082207
// opt-level=0 doesn't take too much stack space,
22092208
// see #2218.
22102209
const UNINIT: ::#prefix::mem::MaybeUninit<#canonical_ident> = ::#prefix::mem::MaybeUninit::uninit();
2210+
let ptr = UNINIT.as_ptr();
22112211
})
22122212
} else {
22132213
None

tests/expectations/tests/16-byte-alignment.rs

Lines changed: 13 additions & 30 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/expectations/tests/16-byte-alignment_1_0.rs

Lines changed: 13 additions & 30 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)