Fix build/clippy errors and update CASR (#1375)

* fix new exciting clippy errors

* fix CASR build errors

* bump casr version

* more clippy whack-a-mole

* allow needless pass by ref mut as it is improperly marked unnecessary
This commit is contained in:
Addison Crump 2023-07-24 15:11:24 +02:00 committed by GitHub
parent b064eb3994
commit 81e9a9a60f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 13 additions and 11 deletions

View File

@ -105,7 +105,7 @@ z3 = { version = "0.11", features = ["static-link-z3"], optional = true } # for
pyo3 = { version = "0.18.3", optional = true, features = ["serde", "macros"] }
concat-idents = { version = "1.1.3", optional = true }
libcasr = { version = "2.5", optional = true}
libcasr = { version = "2.7", optional = true}
# optional-dev deps (change when target.'cfg(accessible(::std))'.test-dependencies will be stable)
serial_test = { version = "2", optional = true }

View File

@ -72,7 +72,7 @@ pub unsafe fn shutdown_handler<SP>(
signal: Signal,
_info: siginfo_t,
_context: &mut ucontext_t,
data: &mut ShutdownSignalData,
data: &ShutdownSignalData,
) where
SP: ShMemProvider,
{

View File

@ -218,7 +218,7 @@ impl<E> TimeoutExecutor<E> {
self.exec_tmout = exec_tmout;
}
pub(crate) fn handle_timeout(&mut self, data: &mut InProcessExecutorHandlerData) -> bool {
pub(crate) fn handle_timeout(&mut self, data: &InProcessExecutorHandlerData) -> bool {
if !self.batch_mode {
return false;
}

View File

@ -23,8 +23,9 @@ use libcasr::{
asan::AsanStacktrace,
constants::{
STACK_FRAME_FILEPATH_IGNORE_REGEXES_CPP, STACK_FRAME_FILEPATH_IGNORE_REGEXES_GO,
STACK_FRAME_FILEPATH_IGNORE_REGEXES_PYTHON, STACK_FRAME_FILEPATH_IGNORE_REGEXES_RUST,
STACK_FRAME_FUNCTION_IGNORE_REGEXES_CPP, STACK_FRAME_FUNCTION_IGNORE_REGEXES_GO,
STACK_FRAME_FILEPATH_IGNORE_REGEXES_JAVA, STACK_FRAME_FILEPATH_IGNORE_REGEXES_PYTHON,
STACK_FRAME_FILEPATH_IGNORE_REGEXES_RUST, STACK_FRAME_FUNCTION_IGNORE_REGEXES_CPP,
STACK_FRAME_FUNCTION_IGNORE_REGEXES_GO, STACK_FRAME_FUNCTION_IGNORE_REGEXES_JAVA,
STACK_FRAME_FUNCTION_IGNORE_REGEXES_PYTHON, STACK_FRAME_FUNCTION_IGNORE_REGEXES_RUST,
},
init_ignored_frames,

View File

@ -280,7 +280,7 @@ where
/// Cull the `Corpus`
#[allow(clippy::unused_self)]
pub fn accounting_cull(&self, state: &mut CS::State) -> Result<(), Error> {
pub fn accounting_cull(&self, state: &CS::State) -> Result<(), Error> {
let Some(top_rated) = state.metadata_map().get::<TopAccountingMetadata>() else {
return Ok(());
};

View File

@ -321,7 +321,7 @@ where
/// Cull the `Corpus` using the `MinimizerScheduler`
#[allow(clippy::unused_self)]
pub fn cull(&self, state: &mut CS::State) -> Result<(), Error> {
pub fn cull(&self, state: &CS::State) -> Result<(), Error> {
let Some(top_rated) = state.metadata_map().get::<TopRatedsMetadata>() else {
return Ok(());
};

View File

@ -27,7 +27,7 @@ struct Bigger(Range<usize>);
impl PartialOrd for Bigger {
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
self.0.len().partial_cmp(&other.0.len())
Some(self.cmp(other))
}
}
@ -43,7 +43,7 @@ struct Earlier(Range<usize>);
impl PartialOrd for Earlier {
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
other.0.start.partial_cmp(&self.0.start)
Some(self.cmp(other))
}
}

View File

@ -60,7 +60,7 @@ pub fn set_seed_fuzz_time<S: HasMetadata>(state: &mut S, fuzz_time: Duration) ->
}
/// Get the time for a single seed to be used by this mutational stage
pub fn get_seed_fuzz_time<S: HasMetadata>(state: &mut S) -> Result<Option<Duration>, Error> {
pub fn get_seed_fuzz_time<S: HasMetadata>(state: &S) -> Result<Option<Duration>, Error> {
state
.metadata_map()
.get::<TuneableMutationalStageMetadata>()
@ -262,7 +262,7 @@ impl TuneableMutationalStage<(), (), (), (), ()> {
}
/// Set the time to mutate a single input in this mutational stage
pub fn seed_fuzz_time<S: HasMetadata>(state: &mut S) -> Result<Option<Duration>, Error> {
pub fn seed_fuzz_time<S: HasMetadata>(state: &S) -> Result<Option<Duration>, Error> {
get_seed_fuzz_time(state)
}
}

View File

@ -7,6 +7,7 @@
allow(clippy::useless_conversion)
)]
#![allow(clippy::needless_pass_by_value)]
#![allow(clippy::needless_pass_by_ref_mut)]
#![allow(clippy::transmute_ptr_to_ptr)]
#![allow(clippy::ptr_cast_constness)]
#![allow(clippy::too_many_arguments)]