about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorMatthias Krüger <476013+matthiaskrgr@users.noreply.github.com>2025-09-30 20:46:45 +0200
committerGitHub <noreply@github.com>2025-09-30 20:46:45 +0200
commitf7c7e34ae4b98edba4049326005c902fb7b6d0ab (patch)
tree91039fa2c84d907f96b8295bed7f6a89b82706ba /compiler/rustc_codegen_llvm/src
parent61b9467af89c18fb2b1e08da1fce2472b2147cc1 (diff)
parent9e79fac0354b2a87515c30e94754413ef99b3675 (diff)
downloadrust-f7c7e34ae4b98edba4049326005c902fb7b6d0ab.tar.gz
rust-f7c7e34ae4b98edba4049326005c902fb7b6d0ab.zip
Rollup merge of #146886 - taiki-e:rc-inner-align, r=Mark-Simulacrum
Add repr(align(2)) to RcInner and ArcInner

`Rc` currently assumes that `RcInner` has at least 2-byte alignment, but on AVR, `usize` has 1-byte alignment (this is because the AVR has 1-byte register sizes, so having 2-byte alignment is generally useless), breaking this assumption.

https://github.com/rust-lang/rust/blob/9f32ccf35fb877270bc44a86a126440f04d676d0/library/alloc/src/rc.rs#L3005-L3008

This PR adds `repr(align(2))` to force `RcInner` to always have at least 2-byte alignment.

Note that `ArcInner` doesn't need `repr(align(2))` because atomic types have the alignment same as its size. This PR adds a comment about this.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions