chore: Bump Edition::CURRENT to 2024

This commit is contained in:
Lukas Wirth 2025-03-14 14:42:09 +01:00
parent 23e8d13531
commit a505420751
24 changed files with 277 additions and 244 deletions

View file

@ -137,13 +137,13 @@ struct HasUnsafe;
impl HasUnsafe {
unsafe fn unsafe_fn(&self) {
let x = &5_usize as *const usize;
let _y = *x;
let _y = unsafe {*x};
}
}
unsafe fn unsafe_fn() {
let x = &5_usize as *const usize;
let _y = *x;
let _y = unsafe {*x};
}
fn main() {
@ -337,7 +337,7 @@ struct S(usize);
impl S {
unsafe fn func(&self) {
let x = &self.0 as *const usize;
let _z = *x;
let _z = unsafe { *x };
}
}
fn main() {
@ -350,7 +350,7 @@ struct S(usize);
impl S {
unsafe fn func(&self) {
let x = &self.0 as *const usize;
let _z = *x;
let _z = unsafe { *x };
}
}
fn main() {

View file

@ -1258,7 +1258,7 @@ fn foo(mut foo: Foo) {
pub struct A {}
pub unsafe fn foo(a: *mut A) {
let mut b = || -> *mut A { &mut *a };
let mut b = || -> *mut A { unsafe { &mut *a } };
//^^^^^ 💡 warn: variable does not need to be mutable
let _ = b();
}