Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions crates/vm/src/frame.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2839,6 +2839,7 @@ impl ExecutingFrame<'_> {
}
}

#[cfg_attr(not(feature = "threading"), allow(clippy::collapsible_if))]
if vm.eval_breaker_tripped() {
if let Err(exception) = vm.check_signals() {
#[cold]
Expand Down
12 changes: 6 additions & 6 deletions crates/vm/src/gc_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ use core::sync::atomic::{AtomicBool, AtomicU32, AtomicUsize, Ordering};
use std::collections::HashSet;

fn elapsed_secs(
#[cfg(target_arch = "wasm32")] _start: &(),
#[cfg(not(target_arch = "wasm32"))] start: &std::time::Instant,
#[cfg(target_arch = "wasm32")] _start: (),
#[cfg(not(target_arch = "wasm32"))] start: std::time::Instant,
) -> f64 {
cfg_select! {
target_arch = "wasm32" => 0.0,
Expand Down Expand Up @@ -528,7 +528,7 @@ impl GcState {
self.generations[i].count.store(0, Ordering::SeqCst);
}

let duration = elapsed_secs(&start_time);
let duration = elapsed_secs(start_time);

self.generations[generation].update_stats(0, 0, 0, duration);
return CollectResult {
Expand Down Expand Up @@ -704,7 +704,7 @@ impl GcState {
self.generations[i].count.store(0, Ordering::SeqCst);
}

let duration = elapsed_secs(&start_time);
let duration = elapsed_secs(start_time);

self.generations[generation].update_stats(0, 0, candidates, duration);
return CollectResult {
Expand All @@ -727,7 +727,7 @@ impl GcState {
self.generations[i].count.store(0, Ordering::SeqCst);
}

let duration = elapsed_secs(&start_time);
let duration = elapsed_secs(start_time);

self.generations[generation].update_stats(0, 0, candidates, duration);
return CollectResult {
Expand Down Expand Up @@ -953,7 +953,7 @@ impl GcState {
self.generations[i].count.store(0, Ordering::SeqCst);
}

let duration = elapsed_secs(&start_time);
let duration = elapsed_secs(start_time);

self.generations[generation].update_stats(collected, 0, candidates, duration);

Expand Down
7 changes: 7 additions & 0 deletions crates/vm/src/stdlib/_signal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,13 @@ pub(crate) mod _signal {
}

#[pyfunction]
#[cfg_attr(
not(any(unix, windows)),
expect(
clippy::unnecessary_wraps,
reason = "WASI does not support signals yet"
)
)]
fn valid_signals(vm: &VirtualMachine) -> PyResult {
use crate::PyPayload;
use crate::builtins::PySet;
Expand Down
2 changes: 1 addition & 1 deletion crates/vm/src/stdlib/posix_compat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ pub(crate) mod module {

#[allow(dead_code)]
fn os_unimpl<T>(func: &str, vm: &VirtualMachine) -> PyResult<T> {
Err(vm.new_os_error(format!("{} is not supported on this platform", func)))
Err(vm.new_os_error(format!("{func} is not supported on this platform")))
}

pub(crate) fn support_funcs() -> Vec<SupportFunc> {
Expand Down
1 change: 1 addition & 0 deletions crates/vm/src/stdlib/time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,7 @@ mod decl {
}

#[pyfunction]
#[cfg_attr(not(any(unix, windows)), expect(clippy::unnecessary_wraps,))]
fn strftime(format: PyStrRef, t: OptionalArg<StructTimeData>, vm: &VirtualMachine) -> PyResult {
#[cfg(any(unix, windows))]
{
Expand Down
Loading