Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 0418d54

Browse files
committedOct 5, 2024
Add a Lint for Pointer to Integer Transmutes in Consts
1 parent 22c4e8e commit 0418d54

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed
 

‎core/src/ptr/mod.rs

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

0 commit comments

Comments
 (0)
Please sign in to comment.