Add a Lint for Pointer to Integer Transmutes in Consts · qinheping/verify-rust-std@0418d54 (original) (raw)

Original file line number Diff line number Diff line change
@@ -1916,6 +1916,7 @@ pub unsafe fn write_volatile(dst: *mut T, src: T) {
1916 1916 /// than trying to adapt this to accommodate that change.
1917 1917 ///
1918 1918 /// Any questions go to @nagisa.
1919 +#[cfg_attr(not(bootstrap), allow(ptr_to_integer_transmute_in_consts))]
1919 1920 #[lang = "align_offset"]
1920 1921 pub(crate) const unsafe fn align_offset<T: Sized>(p: *const T, a: usize) -> usize {
1921 1922 // FIXME(#75598): Direct use of these intrinsics improves codegen significantly at opt-level <=