Announcing Rust 1.70.0#1110
Conversation
|
This definitely needs more work, but a PR will let others start chipping in. |
|
It looks like this didn't get a milestone, somehow, but I think rust-lang/rust#98112 landed in this release? We know that there's UB code in the wild that trips those checks (rust-lang/rust#111487), so might be worth a mention here. A placeholder example, please change as desired: #[repr(align(8))]
struct AlignedArray([u8; 8]);
let a = AlignedArray([0; 8]);
// This dereference is definitely under-aligned, and thus UB
let s = unsafe { *a.0.as_ptr().add(1).cast::<f32>() };
dbg!(s); |
That is in the full release notes, "Insert alignment checks for pointer dereferences as debug assertions" under compatibility. I'm not sure it's worth highlighting more than that, but I could be convinced... |
Co-authored-by: LegionMammal978 <mattlloydhouse@gmail.com>
Co-authored-by: Nathan Stocks <cleancut@github.com>
No description provided.