Skip to content

Commit de3188d

Browse files
authored
Merge pull request #482 from Freax13/fix/cast-u64
silence warning about cast
2 parents 615248f + ce8baea commit de3188d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/structures/idt.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -857,6 +857,12 @@ macro_rules! impl_handler_func_type {
857857
unsafe impl HandlerFuncType for $f {
858858
#[inline]
859859
fn to_virt_addr(self) -> VirtAddr {
860+
// Casting a function pointer to u64 is fine, if the pointer
861+
// width doesn't exeed 64 bits.
862+
#[cfg_attr(
863+
any(target_pointer_width = "32", target_pointer_width = "64"),
864+
allow(clippy::fn_to_numeric_cast)
865+
)]
860866
VirtAddr::new(self as u64)
861867
}
862868
}

0 commit comments

Comments
 (0)