Add unsafe markers to accomodate edition 2024 rules

- Add `unsafe` blocks inside `unsafe fn` using unsafe constructs
- Add `unsafe` qualifier to `extern` blocks
- Add `unsafe` qualifier to `no_mangle` attributes
This commit is contained in:
Samuel Tardieu 2025-04-13 10:08:08 +02:00
parent d19c651c62
commit b3d401ecb1
52 changed files with 639 additions and 556 deletions

View file

@ -15,9 +15,17 @@ union MyOwnMaybeUninit {
// https://github.com/rust-lang/rust/issues/119620
unsafe fn requires_paramenv<S>() {
let mut vec = Vec::<UnsafeCell<*mut S>>::with_capacity(1);
unsafe {
let mut vec = Vec::<UnsafeCell<*mut S>>::with_capacity(1);
//~^ uninit_vec
vec.set_len(1);
}
let mut vec = Vec::<UnsafeCell<*mut S>>::with_capacity(2);
//~^ uninit_vec
vec.set_len(1);
unsafe {
vec.set_len(2);
}
}
fn main() {