Skip to content

Commit

Permalink
Add a Lint for Pointer to Integer Transmutes in Consts
Browse files Browse the repository at this point in the history
  • Loading branch information
veera-sivarajan committed Oct 5, 2024
1 parent 22c4e8e commit 0418d54
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions core/src/ptr/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1916,6 +1916,7 @@ pub unsafe fn write_volatile<T>(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<T: Sized>(p: *const T, a: usize) -> usize {
// FIXME(#75598): Direct use of these intrinsics improves codegen significantly at opt-level <=
Expand Down

0 comments on commit 0418d54

Please sign in to comment.