From 0418d546ad5ec76f7a6dda905f8bf43f2b411a27 Mon Sep 17 00:00:00 2001 From: Veera Date: Sun, 22 Sep 2024 19:32:56 -0400 Subject: [PATCH] Add a Lint for Pointer to Integer Transmutes in Consts --- core/src/ptr/mod.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/core/src/ptr/mod.rs b/core/src/ptr/mod.rs index 08d06cad55d06..8d6560111dad0 100644 --- a/core/src/ptr/mod.rs +++ b/core/src/ptr/mod.rs @@ -1916,6 +1916,7 @@ pub unsafe fn write_volatile(dst: *mut T, src: T) { /// than trying to adapt this to accommodate that change. /// /// Any questions go to @nagisa. +#[cfg_attr(not(bootstrap), allow(ptr_to_integer_transmute_in_consts))] #[lang = "align_offset"] pub(crate) const unsafe fn align_offset(p: *const T, a: usize) -> usize { // FIXME(#75598): Direct use of these intrinsics improves codegen significantly at opt-level <=