mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 18:59:04 +08:00
fix clippy 1.93.0 (#6836)
* fix clippy 1.93.0 * Auto-format: cargo fmt --all --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
1 parent
11a59bb405
commit
125ade5f55
5 files changed
+15
-9
No files matched your search
@@ -553,7 +553,7 @@ mod decl {
|
||||
}
|
||||
|
||||
let mut action: libc::sigaction = core::mem::zeroed();
|
||||
action.sa_sigaction = faulthandler_fatal_error as libc::sighandler_t;
|
||||
action.sa_sigaction = faulthandler_fatal_error as *const () as libc::sighandler_t;
|
||||
// SA_NODEFER flag
|
||||
action.sa_flags = libc::SA_NODEFER;
|
||||
|
||||
@@ -583,7 +583,7 @@ mod decl {
|
||||
|
||||
handler.previous = libc::signal(
|
||||
handler.signum,
|
||||
faulthandler_fatal_error as libc::sighandler_t,
|
||||
faulthandler_fatal_error as *const () as libc::sighandler_t,
|
||||
);
|
||||
|
||||
// SIG_ERR is -1 as sighandler_t (which is usize on Windows)
|
||||
@@ -937,7 +937,10 @@ mod decl {
|
||||
libc::signal(signum, user.previous);
|
||||
libc::raise(signum);
|
||||
// Re-register our handler
|
||||
libc::signal(signum, faulthandler_user_signal as libc::sighandler_t);
|
||||
libc::signal(
|
||||
signum,
|
||||
faulthandler_user_signal as *const () as libc::sighandler_t,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -988,7 +991,10 @@ mod decl {
|
||||
let previous = if !user_signals::is_enabled(signum) {
|
||||
// Install signal handler
|
||||
let prev = unsafe {
|
||||
libc::signal(args.signum, faulthandler_user_signal as libc::sighandler_t)
|
||||
libc::signal(
|
||||
args.signum,
|
||||
faulthandler_user_signal as *const () as libc::sighandler_t,
|
||||
)
|
||||
};
|
||||
if prev == libc::SIG_ERR {
|
||||
return Err(vm.new_os_error(format!(
|
||||
|
||||
@@ -28,7 +28,7 @@ pub fn add_operators(class: &'static Py<PyType>, ctx: &Context) {
|
||||
.slots
|
||||
.hash
|
||||
.load()
|
||||
.is_some_and(|h| h as usize == hash_not_implemented as usize)
|
||||
.is_some_and(|h| h as usize == hash_not_implemented as *const () as usize)
|
||||
{
|
||||
class.set_attr(ctx.names.__hash__, ctx.none.clone().into());
|
||||
continue;
|
||||
|
||||
@@ -964,13 +964,13 @@ pub(crate) mod _ctypes {
|
||||
#[pyattr]
|
||||
fn _memmove_addr(_vm: &VirtualMachine) -> usize {
|
||||
let f = libc::memmove;
|
||||
f as usize
|
||||
f as *const () as usize
|
||||
}
|
||||
|
||||
#[pyattr]
|
||||
fn _memset_addr(_vm: &VirtualMachine) -> usize {
|
||||
let f = libc::memset;
|
||||
f as usize
|
||||
f as *const () as usize
|
||||
}
|
||||
|
||||
#[pyattr]
|
||||
|
||||
@@ -202,7 +202,7 @@ pub(crate) mod _signal {
|
||||
match usize::try_from_borrowed_object(vm, &handler).ok() {
|
||||
Some(SIG_DFL) => SIG_DFL,
|
||||
Some(SIG_IGN) => SIG_IGN,
|
||||
None if handler.is_callable() => run_signal as sighandler_t,
|
||||
None if handler.is_callable() => run_signal as *const () as sighandler_t,
|
||||
_ => return Err(vm.new_type_error(
|
||||
"signal handler must be signal.SIG_IGN, signal.SIG_DFL, or a callable object",
|
||||
)),
|
||||
|
||||
@@ -22,7 +22,7 @@ impl PyMethod {
|
||||
pub fn get(obj: PyObjectRef, name: &Py<PyStr>, vm: &VirtualMachine) -> PyResult<Self> {
|
||||
let cls = obj.class();
|
||||
let getattro = cls.slots.getattro.load().unwrap();
|
||||
if getattro as usize != PyBaseObject::getattro as usize {
|
||||
if getattro as usize != PyBaseObject::getattro as *const () as usize {
|
||||
return obj.get_attr(name, vm).map(Self::Attribute);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user