On Sat, Nov 9, 2024 at 9:18 AM David Gow davidgow@google.com wrote:
Is there somewhere else we can put the attribute to support this without having to either disable the warning, or use the experimental feature globally?
Yeah, on the item, e.g. https://godbolt.org/z/oo8osadn4:
const _: () = { static mut X: i32 = 42;
#[allow(unused_unsafe)] static mut S: *const i32 = unsafe { core::ptr::addr_of_mut!(X) }; };
Cheers, Miguel