The function allocate_for_ptr is passed a *const [T], which it turns into a &RcBox<[T]>. Unfortunately, the latter has an alignment of 8 even if T has smaller alignment. This leads to UB because we have a not-sufficiently-aligned reference.
This got introduced in #42565.
Found by miri (in my branch that verified the validity invariants).
Cc @murarth @Centril @aturon
The function
allocate_for_ptris passed a*const [T], which it turns into a&RcBox<[T]>. Unfortunately, the latter has an alignment of 8 even ifThas smaller alignment. This leads to UB because we have a not-sufficiently-aligned reference.This got introduced in #42565.
Found by miri (in my branch that verified the validity invariants).
Cc @murarth @Centril @aturon