Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Announcing Rust 1.70.0 #1110

Merged
merged 10 commits into from
Jun 1, 2023
Merged

Conversation

cuviper
Copy link
Member

@cuviper cuviper commented May 30, 2023

No description provided.

@cuviper
Copy link
Member Author

cuviper commented May 30, 2023

This definitely needs more work, but a PR will let others start chipping in.

posts/2023-06-01-Rust-1.70.0.md Outdated Show resolved Hide resolved
posts/2023-06-01-Rust-1.70.0.md Show resolved Hide resolved
posts/2023-06-01-Rust-1.70.0.md Outdated Show resolved Hide resolved
posts/2023-06-01-Rust-1.70.0.md Outdated Show resolved Hide resolved
@scottmcm
Copy link
Member

scottmcm commented May 30, 2023

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);

https://play.rust-lang.org/?version=beta&mode=debug&edition=2021&gist=b20e8bb0b0cd066b1da9fcbcf8e0b252

thread 'main' panicked at 'misaligned pointer dereference: address must be a multiple of 0x4 but is 0x7ffc6af764e9', src/main.rs:6:22

@cuviper
Copy link
Member Author

cuviper commented May 31, 2023

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.

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 <[email protected]>
@cuviper cuviper marked this pull request as ready for review June 1, 2023 17:50
@Mark-Simulacrum Mark-Simulacrum merged commit 71c15ed into rust-lang:master Jun 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.