rust/library/alloc/src
Matthias Krüger f7c7e34ae4
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.

9f32ccf35f/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.
2025-09-30 20:46:45 +02:00
..
boxed remove deprecated Error::description in impls 2025-08-26 06:36:53 +00:00
collections Use Iterator::eq and (dogfood) eq_by in compiler and library 2025-09-29 08:08:05 +03:00
ffi alloc: simplify Default for Box<CStr> and Rc<CStr> 2025-09-24 14:13:34 +02:00
raw_vec Remove most #[track_caller] from allocating Vec methods 2025-09-25 20:52:03 +02:00
vec Auto merge of #147042 - Noratrieb:untrack-caller-vec, r=tgross35 2025-09-28 03:23:45 +00:00
wtf8 Diff-massaging commit 2025-08-20 20:31:33 -04:00
alloc.rs Change the cfg to a dash 2025-09-21 13:12:20 -04:00
borrow.rs Constify conversion traits 2025-09-01 21:38:26 -04:00
boxed.rs Update CURRENT_RUSTC_VERSION post-bump 2025-09-26 18:41:32 -04:00
bstr.rs Fully test the alloc crate through alloctests 2025-03-07 19:11:13 +00:00
fmt.rs Fix format string grammar in docs and improve alignment error message 2025-08-27 20:45:41 +05:30
lib.miri.rs add 'x.py miri', and make it work for 'library/{core,alloc,std}' 2024-04-03 20:27:20 +02:00
lib.rs Remove cfg(bootstrap) for doc_cfg feature following #141925 2025-09-27 11:29:49 +02:00
macros.rs Streamline the format macro. 2025-04-28 06:56:13 +10:00
rc.rs Rollup merge of #146886 - taiki-e:rc-inner-align, r=Mark-Simulacrum 2025-09-30 20:46:45 +02:00
slice.rs Remove [T]::array_chunks(_mut) 2025-07-27 23:03:07 -07:00
str.rs optimization: Don't include ASCII characters in Unicode tables 2025-09-07 15:21:24 +02:00
string.rs Remove most #[track_caller] from allocating Vec methods 2025-09-25 20:52:03 +02:00
sync.rs Rollup merge of #146886 - taiki-e:rc-inner-align, r=Mark-Simulacrum 2025-09-30 20:46:45 +02:00
task.rs Stabilize noop_waker 2024-12-05 14:14:17 -08:00