@@ -13,7 +13,7 @@ LL | let _ptr = unsafe { std::mem::transmute::<usize, *const u8>(a) };
1313help: use `as` cast instead to use a previously exposed provenance
1414 |
1515LL - let _ptr = unsafe { std::mem::transmute::<usize, *const u8>(a) };
16- LL + let _ptr = unsafe { a as *const u8 };
16+ LL + let _ptr = unsafe { std::ptr::with_exposed_provenance::<u8>(a) };
1717 |
1818
1919warning: transmuting an integer to a pointer creates a pointer without provenance
@@ -30,7 +30,7 @@ LL | let _ptr = unsafe { std::mem::transmute::<usize, &'static u8>(a) };
3030help: use `as` cast instead to use a previously exposed provenance
3131 |
3232LL - let _ptr = unsafe { std::mem::transmute::<usize, &'static u8>(a) };
33- LL + let _ptr = unsafe { &*(a as *const u8 ) };
33+ LL + let _ptr = unsafe { &*std::ptr::with_exposed_provenance::<u8>(a ) };
3434 |
3535
3636warning: transmuting an integer to a pointer creates a pointer without provenance
@@ -47,7 +47,7 @@ LL | let _ptr = unsafe { std::mem::transmute::<usize, *const u8>(42usize) };
4747help: use `as` cast instead to use a previously exposed provenance
4848 |
4949LL - let _ptr = unsafe { std::mem::transmute::<usize, *const u8>(42usize) };
50- LL + let _ptr = unsafe { 42usize as *const u8 };
50+ LL + let _ptr = unsafe { std::ptr::with_exposed_provenance::<u8>(42usize) };
5151 |
5252
5353warning: transmuting an integer to a pointer creates a pointer without provenance
@@ -64,7 +64,7 @@ LL | let _ptr = unsafe { std::mem::transmute::<usize, *const u8>(a + a) };
6464help: use `as` cast instead to use a previously exposed provenance
6565 |
6666LL - let _ptr = unsafe { std::mem::transmute::<usize, *const u8>(a + a) };
67- LL + let _ptr = unsafe { (a + a) as *const u8 };
67+ LL + let _ptr = unsafe { std::ptr::with_exposed_provenance::<u8> (a + a) };
6868 |
6969
7070warning: transmuting an integer to a pointer creates a pointer without provenance
0 commit comments