Skip to content

Commit c263e50

Browse files
committed
fix clippy 1.93.0
1 parent 11a59bb commit c263e50

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

crates/stdlib/src/faulthandler.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ mod decl {
553553
}
554554

555555
let mut action: libc::sigaction = core::mem::zeroed();
556-
action.sa_sigaction = faulthandler_fatal_error as libc::sighandler_t;
556+
action.sa_sigaction = faulthandler_fatal_error as *const () as libc::sighandler_t;
557557
// SA_NODEFER flag
558558
action.sa_flags = libc::SA_NODEFER;
559559

@@ -937,7 +937,7 @@ mod decl {
937937
libc::signal(signum, user.previous);
938938
libc::raise(signum);
939939
// Re-register our handler
940-
libc::signal(signum, faulthandler_user_signal as libc::sighandler_t);
940+
libc::signal(signum, faulthandler_user_signal as *const () as libc::sighandler_t);
941941
}
942942
}
943943
}
@@ -988,7 +988,7 @@ mod decl {
988988
let previous = if !user_signals::is_enabled(signum) {
989989
// Install signal handler
990990
let prev = unsafe {
991-
libc::signal(args.signum, faulthandler_user_signal as libc::sighandler_t)
991+
libc::signal(args.signum, faulthandler_user_signal as *const () as libc::sighandler_t)
992992
};
993993
if prev == libc::SIG_ERR {
994994
return Err(vm.new_os_error(format!(

crates/vm/src/class.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ pub fn add_operators(class: &'static Py<PyType>, ctx: &Context) {
2828
.slots
2929
.hash
3030
.load()
31-
.is_some_and(|h| h as usize == hash_not_implemented as usize)
31+
.is_some_and(|h| h as usize == hash_not_implemented as *const () as usize)
3232
{
3333
class.set_attr(ctx.names.__hash__, ctx.none.clone().into());
3434
continue;

crates/vm/src/stdlib/ctypes.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -964,13 +964,13 @@ pub(crate) mod _ctypes {
964964
#[pyattr]
965965
fn _memmove_addr(_vm: &VirtualMachine) -> usize {
966966
let f = libc::memmove;
967-
f as usize
967+
f as *const () as usize
968968
}
969969

970970
#[pyattr]
971971
fn _memset_addr(_vm: &VirtualMachine) -> usize {
972972
let f = libc::memset;
973-
f as usize
973+
f as *const () as usize
974974
}
975975

976976
#[pyattr]

crates/vm/src/stdlib/signal.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ pub(crate) mod _signal {
202202
match usize::try_from_borrowed_object(vm, &handler).ok() {
203203
Some(SIG_DFL) => SIG_DFL,
204204
Some(SIG_IGN) => SIG_IGN,
205-
None if handler.is_callable() => run_signal as sighandler_t,
205+
None if handler.is_callable() => run_signal as *const () as sighandler_t,
206206
_ => return Err(vm.new_type_error(
207207
"signal handler must be signal.SIG_IGN, signal.SIG_DFL, or a callable object",
208208
)),

crates/vm/src/vm/method.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ impl PyMethod {
2222
pub fn get(obj: PyObjectRef, name: &Py<PyStr>, vm: &VirtualMachine) -> PyResult<Self> {
2323
let cls = obj.class();
2424
let getattro = cls.slots.getattro.load().unwrap();
25-
if getattro as usize != PyBaseObject::getattro as usize {
25+
if getattro as usize != PyBaseObject::getattro as *const () as usize {
2626
return obj.get_attr(name, vm).map(Self::Attribute);
2727
}
2828

0 commit comments

Comments
 (0)