From 3d436b75196f3b065f6e40c65df94f36bfabf8f7 Mon Sep 17 00:00:00 2001 From: Jordan McLeod Date: Thu, 4 Nov 2021 04:59:49 -0400 Subject: [PATCH] Upgrade to Rust 2021 Edition (#340) * Enable missing const_xxh3 feature * Move to Rust 2021 Edition * Fix clippy complaints * Remove imports made unecessary in 2021 edition --- bindings/pylibafl/Cargo.toml | 2 +- fuzzers/baby_fuzzer/Cargo.toml | 2 +- fuzzers/baby_fuzzer_gramatron/Cargo.toml | 2 +- fuzzers/baby_fuzzer_tokens/Cargo.toml | 2 +- fuzzers/baby_no_std/Cargo.toml | 2 +- fuzzers/forkserver_simple/Cargo.toml | 4 ++-- fuzzers/frida_libpng/Cargo.toml | 2 +- fuzzers/fuzzbench/Cargo.toml | 2 +- fuzzers/fuzzbench_gsoc/Cargo.toml | 2 +- fuzzers/fuzzbench_qemu/Cargo.toml | 2 +- fuzzers/generic_inmemory/Cargo.toml | 2 +- fuzzers/libfuzzer_libmozjpeg/Cargo.toml | 2 +- fuzzers/libfuzzer_libpng/Cargo.toml | 2 +- fuzzers/libfuzzer_libpng_launcher/Cargo.toml | 2 +- fuzzers/libfuzzer_reachability/Cargo.toml | 2 +- fuzzers/libfuzzer_stb_image/Cargo.toml | 2 +- fuzzers/libfuzzer_stb_image_concolic/fuzzer/Cargo.toml | 2 +- fuzzers/libfuzzer_stb_image_concolic/runtime/Cargo.toml | 2 +- fuzzers/libfuzzer_stb_image_sugar/Cargo.toml | 2 +- fuzzers/push_harness/Cargo.toml | 4 ++-- fuzzers/tutorial/Cargo.toml | 2 +- libafl/Cargo.toml | 4 ++-- libafl/benches/hash_speeds.rs | 2 -- libafl/examples/llmp_test/main.rs | 6 +++--- libafl/src/bolts/llmp.rs | 5 ++--- libafl/src/bolts/os/unix_signals.rs | 1 - libafl/src/bolts/os/windows_exceptions.rs | 1 - libafl/src/bolts/shmem.rs | 7 ++----- libafl/src/events/mod.rs | 8 +------- libafl/src/events/simple.rs | 1 - libafl/src/executors/forkserver.rs | 4 ++-- libafl/src/mutators/mutations.rs | 1 - libafl/src/mutators/token_mutations.rs | 2 +- libafl/src/observers/concolic/serialization_format.rs | 5 +---- libafl/src/stages/concolic.rs | 1 - libafl/src/stats/mod.rs | 2 -- libafl_cc/Cargo.toml | 2 +- libafl_concolic/symcc_libafl/Cargo.toml | 4 ++-- libafl_concolic/symcc_runtime/Cargo.toml | 2 +- libafl_concolic/symcc_runtime/src/filter/coverage.rs | 1 - libafl_concolic/test/dump_constraints/Cargo.toml | 4 ++-- libafl_concolic/test/runtime_test/Cargo.toml | 2 +- libafl_derive/Cargo.toml | 2 +- libafl_frida/Cargo.toml | 2 +- libafl_qemu/Cargo.toml | 2 +- libafl_qemu/src/emu.rs | 1 - libafl_sugar/Cargo.toml | 2 +- libafl_targets/Cargo.toml | 2 +- 48 files changed, 49 insertions(+), 73 deletions(-) diff --git a/bindings/pylibafl/Cargo.toml b/bindings/pylibafl/Cargo.toml index e0ec8c8a0e..3be919a71b 100644 --- a/bindings/pylibafl/Cargo.toml +++ b/bindings/pylibafl/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "pylibafl" version = "0.1.0" -edition = "2018" +edition = "2021" [dependencies] pyo3 = { version = "0.14.3", features = ["extension-module"] } diff --git a/fuzzers/baby_fuzzer/Cargo.toml b/fuzzers/baby_fuzzer/Cargo.toml index 55b49fcf24..edec167c48 100644 --- a/fuzzers/baby_fuzzer/Cargo.toml +++ b/fuzzers/baby_fuzzer/Cargo.toml @@ -2,7 +2,7 @@ name = "baby_fuzzer" version = "0.6.1" authors = ["Andrea Fioraldi ", "Dominik Maier "] -edition = "2018" +edition = "2021" [features] default = ["std"] diff --git a/fuzzers/baby_fuzzer_gramatron/Cargo.toml b/fuzzers/baby_fuzzer_gramatron/Cargo.toml index fa1f4c91b8..c56b765308 100644 --- a/fuzzers/baby_fuzzer_gramatron/Cargo.toml +++ b/fuzzers/baby_fuzzer_gramatron/Cargo.toml @@ -2,7 +2,7 @@ name = "baby_fuzzer" version = "0.6.0" authors = ["Andrea Fioraldi ", "Dominik Maier "] -edition = "2018" +edition = "2021" [features] default = ["std"] diff --git a/fuzzers/baby_fuzzer_tokens/Cargo.toml b/fuzzers/baby_fuzzer_tokens/Cargo.toml index d5b0b0997d..db4814bb01 100644 --- a/fuzzers/baby_fuzzer_tokens/Cargo.toml +++ b/fuzzers/baby_fuzzer_tokens/Cargo.toml @@ -2,7 +2,7 @@ name = "baby_fuzzer" version = "0.6.0" authors = ["Andrea Fioraldi ", "Dominik Maier "] -edition = "2018" +edition = "2021" [features] default = ["std"] diff --git a/fuzzers/baby_no_std/Cargo.toml b/fuzzers/baby_no_std/Cargo.toml index fdfd99bc55..3d335caf20 100644 --- a/fuzzers/baby_no_std/Cargo.toml +++ b/fuzzers/baby_no_std/Cargo.toml @@ -2,7 +2,7 @@ name = "baby_no_std" version = "0.6.1" authors = ["Andrea Fioraldi ", "Dominik Maier "] -edition = "2018" +edition = "2021" [profile.dev] panic = "abort" diff --git a/fuzzers/forkserver_simple/Cargo.toml b/fuzzers/forkserver_simple/Cargo.toml index 28446315cd..c8fd88515b 100644 --- a/fuzzers/forkserver_simple/Cargo.toml +++ b/fuzzers/forkserver_simple/Cargo.toml @@ -2,7 +2,7 @@ name = "forkserver_simple" version = "0.6.1" authors = ["tokatoka "] -edition = "2018" +edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -16,4 +16,4 @@ codegen-units = 1 opt-level = 3 [dependencies] -libafl = { path = "../../libafl/" } \ No newline at end of file +libafl = { path = "../../libafl/" } diff --git a/fuzzers/frida_libpng/Cargo.toml b/fuzzers/frida_libpng/Cargo.toml index bf5e1883e0..ca6acb30a8 100644 --- a/fuzzers/frida_libpng/Cargo.toml +++ b/fuzzers/frida_libpng/Cargo.toml @@ -2,7 +2,7 @@ name = "frida_libpng" version = "0.6.1" authors = ["Andrea Fioraldi ", "Dominik Maier "] -edition = "2018" +edition = "2021" build = "build.rs" [features] diff --git a/fuzzers/fuzzbench/Cargo.toml b/fuzzers/fuzzbench/Cargo.toml index 0c474a4380..8ebea0ebd8 100644 --- a/fuzzers/fuzzbench/Cargo.toml +++ b/fuzzers/fuzzbench/Cargo.toml @@ -2,7 +2,7 @@ name = "fuzzbench" version = "0.6.1" authors = ["Andrea Fioraldi ", "Dominik Maier "] -edition = "2018" +edition = "2021" [features] default = ["std"] diff --git a/fuzzers/fuzzbench_gsoc/Cargo.toml b/fuzzers/fuzzbench_gsoc/Cargo.toml index 0c474a4380..8ebea0ebd8 100644 --- a/fuzzers/fuzzbench_gsoc/Cargo.toml +++ b/fuzzers/fuzzbench_gsoc/Cargo.toml @@ -2,7 +2,7 @@ name = "fuzzbench" version = "0.6.1" authors = ["Andrea Fioraldi ", "Dominik Maier "] -edition = "2018" +edition = "2021" [features] default = ["std"] diff --git a/fuzzers/fuzzbench_qemu/Cargo.toml b/fuzzers/fuzzbench_qemu/Cargo.toml index 82418e4b7f..d88c0ef936 100644 --- a/fuzzers/fuzzbench_qemu/Cargo.toml +++ b/fuzzers/fuzzbench_qemu/Cargo.toml @@ -2,7 +2,7 @@ name = "fuzzbench_qemu" version = "0.6.1" authors = ["Andrea Fioraldi ", "Dominik Maier "] -edition = "2018" +edition = "2021" [features] default = ["std"] diff --git a/fuzzers/generic_inmemory/Cargo.toml b/fuzzers/generic_inmemory/Cargo.toml index d76315cfa7..764012bb1c 100644 --- a/fuzzers/generic_inmemory/Cargo.toml +++ b/fuzzers/generic_inmemory/Cargo.toml @@ -2,7 +2,7 @@ name = "generic_inmemory" version = "0.6.1" authors = ["Andrea Fioraldi ", "Dominik Maier "] -edition = "2018" +edition = "2021" [features] default = ["std"] diff --git a/fuzzers/libfuzzer_libmozjpeg/Cargo.toml b/fuzzers/libfuzzer_libmozjpeg/Cargo.toml index 042b334bfd..83f229de66 100644 --- a/fuzzers/libfuzzer_libmozjpeg/Cargo.toml +++ b/fuzzers/libfuzzer_libmozjpeg/Cargo.toml @@ -2,7 +2,7 @@ name = "libfuzzer_libmozjpeg" version = "0.6.1" authors = ["Andrea Fioraldi ", "Dominik Maier "] -edition = "2018" +edition = "2021" [features] default = ["std"] diff --git a/fuzzers/libfuzzer_libpng/Cargo.toml b/fuzzers/libfuzzer_libpng/Cargo.toml index b85308d9f8..93ccfce014 100644 --- a/fuzzers/libfuzzer_libpng/Cargo.toml +++ b/fuzzers/libfuzzer_libpng/Cargo.toml @@ -2,7 +2,7 @@ name = "libfuzzer_libpng" version = "0.6.1" authors = ["Andrea Fioraldi ", "Dominik Maier "] -edition = "2018" +edition = "2021" [features] default = ["std"] diff --git a/fuzzers/libfuzzer_libpng_launcher/Cargo.toml b/fuzzers/libfuzzer_libpng_launcher/Cargo.toml index 25da82686f..e72dfee7d0 100644 --- a/fuzzers/libfuzzer_libpng_launcher/Cargo.toml +++ b/fuzzers/libfuzzer_libpng_launcher/Cargo.toml @@ -2,7 +2,7 @@ name = "libfuzzer_libpng_launcher" version = "0.6.1" authors = ["Andrea Fioraldi ", "Dominik Maier "] -edition = "2018" +edition = "2021" [features] default = ["std"] diff --git a/fuzzers/libfuzzer_reachability/Cargo.toml b/fuzzers/libfuzzer_reachability/Cargo.toml index 5938ea5885..71fa7caf9b 100644 --- a/fuzzers/libfuzzer_reachability/Cargo.toml +++ b/fuzzers/libfuzzer_reachability/Cargo.toml @@ -2,7 +2,7 @@ name = "libfuzzer_reachability" version = "0.6.1" authors = ["Andrea Fioraldi ", "Dominik Maier "] -edition = "2018" +edition = "2021" [features] default = ["std"] diff --git a/fuzzers/libfuzzer_stb_image/Cargo.toml b/fuzzers/libfuzzer_stb_image/Cargo.toml index 98b182e869..5cf980b4b2 100644 --- a/fuzzers/libfuzzer_stb_image/Cargo.toml +++ b/fuzzers/libfuzzer_stb_image/Cargo.toml @@ -2,7 +2,7 @@ name = "libfuzzer_stb_image" version = "0.6.1" authors = ["Andrea Fioraldi ", "Dominik Maier "] -edition = "2018" +edition = "2021" build = "build.rs" [features] diff --git a/fuzzers/libfuzzer_stb_image_concolic/fuzzer/Cargo.toml b/fuzzers/libfuzzer_stb_image_concolic/fuzzer/Cargo.toml index 4c4f444214..1a6405f934 100644 --- a/fuzzers/libfuzzer_stb_image_concolic/fuzzer/Cargo.toml +++ b/fuzzers/libfuzzer_stb_image_concolic/fuzzer/Cargo.toml @@ -2,7 +2,7 @@ name = "libfuzzer_stb_image_concolic" version = "0.6.1" authors = ["Andrea Fioraldi ", "Dominik Maier ", "Julius Hohnerlein"] -edition = "2018" +edition = "2021" build = "build.rs" [features] diff --git a/fuzzers/libfuzzer_stb_image_concolic/runtime/Cargo.toml b/fuzzers/libfuzzer_stb_image_concolic/runtime/Cargo.toml index e5a847392e..9b0348102a 100644 --- a/fuzzers/libfuzzer_stb_image_concolic/runtime/Cargo.toml +++ b/fuzzers/libfuzzer_stb_image_concolic/runtime/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "example_runtime" version = "0.1.0" -edition = "2018" +edition = "2021" authors = ["Julius Hohnerlein "] [lib] diff --git a/fuzzers/libfuzzer_stb_image_sugar/Cargo.toml b/fuzzers/libfuzzer_stb_image_sugar/Cargo.toml index 11733a9b05..474ca64037 100644 --- a/fuzzers/libfuzzer_stb_image_sugar/Cargo.toml +++ b/fuzzers/libfuzzer_stb_image_sugar/Cargo.toml @@ -2,7 +2,7 @@ name = "libfuzzer_stb_image" version = "0.6.1" authors = ["Andrea Fioraldi ", "Dominik Maier "] -edition = "2018" +edition = "2021" build = "build.rs" [features] diff --git a/fuzzers/push_harness/Cargo.toml b/fuzzers/push_harness/Cargo.toml index 690d4db5bf..5ac8be3a91 100644 --- a/fuzzers/push_harness/Cargo.toml +++ b/fuzzers/push_harness/Cargo.toml @@ -2,7 +2,7 @@ name = "push_harness" version = "0.5.0" authors = ["Andrea Fioraldi ", "Dominik Maier "] -edition = "2018" +edition = "2021" [features] default = ["std"] @@ -20,4 +20,4 @@ debug = true [dependencies] libafl = { path = "../../libafl/" } -klo-routines = { version = "0.1.0", git = "https://github.com/andreafioraldi/klo-routines.git", rev = "b8e2fb6" } \ No newline at end of file +klo-routines = { version = "0.1.0", git = "https://github.com/andreafioraldi/klo-routines.git", rev = "b8e2fb6" } diff --git a/fuzzers/tutorial/Cargo.toml b/fuzzers/tutorial/Cargo.toml index adfdfe5d69..bf96d69025 100644 --- a/fuzzers/tutorial/Cargo.toml +++ b/fuzzers/tutorial/Cargo.toml @@ -2,7 +2,7 @@ name = "tutorial" version = "0.6.1" authors = ["Andrea Fioraldi ", "Dominik Maier "] -edition = "2018" +edition = "2021" [features] default = ["std"] diff --git a/libafl/Cargo.toml b/libafl/Cargo.toml index c8f8205776..9ba3e82a44 100644 --- a/libafl/Cargo.toml +++ b/libafl/Cargo.toml @@ -8,7 +8,7 @@ repository = "https://github.com/AFLplusplus/LibAFL/" readme = "../README.md" license = "MIT OR Apache-2.0" keywords = ["fuzzing", "testing", "security"] -edition = "2018" +edition = "2021" build = "build.rs" [build-dependencies] @@ -18,7 +18,7 @@ rustc_version = "0.4" criterion = "0.3" # Benchmarking ahash = "0.7" # another hash fxhash = "0.2.1" # yet another hash -xxhash-rust = { version = "0.8.2", features = ["xxh3"] } # xxh3 hashing for rust +xxhash-rust = { version = "0.8.2", features = ["xxh3", "const_xxh3"] } # xxh3 hashing for rust serde_json = "1.0.60" num_cpus = "1.0" # cpu count, for llmp example serial_test = "0.5" diff --git a/libafl/benches/hash_speeds.rs b/libafl/benches/hash_speeds.rs index fae7f5884b..577224c677 100644 --- a/libafl/benches/hash_speeds.rs +++ b/libafl/benches/hash_speeds.rs @@ -1,7 +1,5 @@ //! Compare the speed of rust hash implementations -use ahash; -use fxhash; use std::hash::Hasher; use xxhash_rust::const_xxh3; use xxhash_rust::xxh3; diff --git a/libafl/examples/llmp_test/main.rs b/libafl/examples/llmp_test/main.rs index 43a73ea375..a605bab15c 100644 --- a/libafl/examples/llmp_test/main.rs +++ b/libafl/examples/llmp_test/main.rs @@ -4,7 +4,7 @@ This shows how llmp can be used directly, without libafl abstractions extern crate alloc; #[cfg(all(unix, feature = "std"))] -use core::{convert::TryInto, time::Duration}; +use core::time::Duration; #[cfg(all(unix, feature = "std"))] use std::{thread, time}; @@ -124,13 +124,13 @@ fn main() { .expect("no mode specified, chose 'broker', 'b2b', 'ctr', 'adder', or 'large'"); let port: u16 = std::env::args() .nth(2) - .unwrap_or("1337".into()) + .unwrap_or_else(|| "1337".into()) .parse::() .unwrap(); // in the b2b use-case, this is our "own" port, we connect to the "normal" broker node on startup. let b2b_port: u16 = std::env::args() .nth(3) - .unwrap_or("4242".into()) + .unwrap_or_else(|| "4242".into()) .parse::() .unwrap(); println!("Launching in mode {} on port {}", mode, port); diff --git a/libafl/src/bolts/llmp.rs b/libafl/src/bolts/llmp.rs index 1d58612f85..e1467ea2ed 100644 --- a/libafl/src/bolts/llmp.rs +++ b/libafl/src/bolts/llmp.rs @@ -62,7 +62,6 @@ For broker2broker communication, all messages are forwarded via network sockets. use alloc::{string::String, vec::Vec}; use core::{ cmp::max, - convert::{TryFrom, TryInto}, fmt::Debug, mem::size_of, ptr, slice, @@ -896,7 +895,7 @@ where /// So if [`alloc_next`] fails, create new page if necessary, use this function, /// place `EOP`, commit `EOP`, reset, alloc again on the new space. unsafe fn alloc_eop(&mut self) -> Result<*mut LlmpMsg, Error> { - let mut map = self.out_maps.last_mut().unwrap(); + let map = self.out_maps.last_mut().unwrap(); let page = map.page_mut(); let last_msg = self.last_msg_sent; if (*page).size_used + EOP_MSG_SIZE > (*page).size_total { @@ -906,7 +905,7 @@ where let mut ret: *mut LlmpMsg = if last_msg.is_null() { (*page).messages.as_mut_ptr() } else { - llmp_next_msg_ptr_checked(&mut map, last_msg, EOP_MSG_SIZE)? + llmp_next_msg_ptr_checked(map, last_msg, EOP_MSG_SIZE)? }; if (*ret).tag == LLMP_TAG_UNINITIALIZED { panic!("Did not call send() on last message!"); diff --git a/libafl/src/bolts/os/unix_signals.rs b/libafl/src/bolts/os/unix_signals.rs index 815f3cb950..af8ae64c3e 100644 --- a/libafl/src/bolts/os/unix_signals.rs +++ b/libafl/src/bolts/os/unix_signals.rs @@ -2,7 +2,6 @@ use alloc::vec::Vec; use core::{ cell::UnsafeCell, - convert::TryFrom, fmt::{self, Display, Formatter}, mem, ptr, ptr::write_volatile, diff --git a/libafl/src/bolts/os/windows_exceptions.rs b/libafl/src/bolts/os/windows_exceptions.rs index 487edc9a8f..c8f55a5bff 100644 --- a/libafl/src/bolts/os/windows_exceptions.rs +++ b/libafl/src/bolts/os/windows_exceptions.rs @@ -12,7 +12,6 @@ use std::os::raw::{c_long, c_void}; use alloc::vec::Vec; use core::{ cell::UnsafeCell, - convert::TryFrom, fmt::{self, Display, Formatter}, ptr, ptr::write_volatile, diff --git a/libafl/src/bolts/shmem.rs b/libafl/src/bolts/shmem.rs index 3d08779228..f7a2dc6a13 100644 --- a/libafl/src/bolts/shmem.rs +++ b/libafl/src/bolts/shmem.rs @@ -63,10 +63,7 @@ pub type StdShMemService = DummyShMemService; use serde::{Deserialize, Serialize}; #[cfg(feature = "std")] -use std::{ - convert::{TryFrom, TryInto}, - env, -}; +use std::env; #[cfg(all(unix, feature = "std"))] use crate::bolts::os::pipes::Pipe; @@ -487,7 +484,7 @@ pub mod unix_shmem { #[cfg(all(unix, feature = "std", not(target_os = "android")))] mod default { - use core::{convert::TryInto, ptr, slice}; + use core::{ptr, slice}; use libc::{ c_int, c_long, c_uchar, c_uint, c_ulong, c_ushort, close, ftruncate, mmap, munmap, perror, shm_open, shm_unlink, shmat, shmctl, shmget, diff --git a/libafl/src/events/mod.rs b/libafl/src/events/mod.rs index 62546a5ed9..a2e0937de7 100644 --- a/libafl/src/events/mod.rs +++ b/libafl/src/events/mod.rs @@ -19,18 +19,12 @@ use crate::{ /// A per-fuzzer unique `ID`, usually starting with `0` and increasing /// by `1` in multiprocessed `EventManager`s, such as [`self::llmp::LlmpEventManager`]. -#[derive(Clone, Copy, Debug, PartialEq, Eq)] +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)] pub struct EventManagerId { /// The id pub id: usize, } -impl Default for EventManagerId { - fn default() -> Self { - Self { id: 0 } - } -} - #[cfg(feature = "introspection")] use crate::stats::ClientPerfStats; #[cfg(feature = "introspection")] diff --git a/libafl/src/events/simple.rs b/libafl/src/events/simple.rs index 382b59a198..fe76642b08 100644 --- a/libafl/src/events/simple.rs +++ b/libafl/src/events/simple.rs @@ -12,7 +12,6 @@ use crate::{ use alloc::{string::ToString, vec::Vec}; #[cfg(feature = "std")] use core::{ - convert::TryInto, marker::PhantomData, sync::atomic::{compiler_fence, Ordering}, }; diff --git a/libafl/src/executors/forkserver.rs b/libafl/src/executors/forkserver.rs index 32782588ad..2340b0c451 100644 --- a/libafl/src/executors/forkserver.rs +++ b/libafl/src/executors/forkserver.rs @@ -722,11 +722,11 @@ mod tests { .new_map(MAP_SIZE as usize) .unwrap(); shmem.write_to_env("__AFL_SHM_ID").unwrap(); - let mut shmem_map = shmem.map_mut(); + let shmem_map = shmem.map_mut(); let edges_observer = HitcountsMapObserver::new(ConstMapObserver::<_, MAP_SIZE>::new( "shared_mem", - &mut shmem_map, + shmem_map, )); let executor = ForkserverExecutor::::new( diff --git a/libafl/src/mutators/mutations.rs b/libafl/src/mutators/mutations.rs index 2b768f8cd5..91a908afe7 100644 --- a/libafl/src/mutators/mutations.rs +++ b/libafl/src/mutators/mutations.rs @@ -12,7 +12,6 @@ use crate::{ use alloc::{borrow::ToOwned, vec::Vec}; use core::{ cmp::{max, min}, - convert::TryInto, marker::PhantomData, mem::size_of, }; diff --git a/libafl/src/mutators/token_mutations.rs b/libafl/src/mutators/token_mutations.rs index 87546850ab..1ed1ccd397 100644 --- a/libafl/src/mutators/token_mutations.rs +++ b/libafl/src/mutators/token_mutations.rs @@ -1,7 +1,7 @@ //! Tokens are what afl calls extras or dictionaries. //! They may be inserted as part of mutations during fuzzing. use alloc::vec::Vec; -use core::{convert::TryInto, marker::PhantomData, mem::size_of}; +use core::{marker::PhantomData, mem::size_of}; use serde::{Deserialize, Serialize}; #[cfg(feature = "std")] diff --git a/libafl/src/observers/concolic/serialization_format.rs b/libafl/src/observers/concolic/serialization_format.rs index c27521795b..58aeffab50 100644 --- a/libafl/src/observers/concolic/serialization_format.rs +++ b/libafl/src/observers/concolic/serialization_format.rs @@ -43,10 +43,7 @@ #![cfg(feature = "std")] -use std::{ - convert::TryFrom, - io::{self, Cursor, Read, Seek, SeekFrom, Write}, -}; +use std::io::{self, Cursor, Read, Seek, SeekFrom, Write}; use bincode::{DefaultOptions, Options}; diff --git a/libafl/src/stages/concolic.rs b/libafl/src/stages/concolic.rs index 4bc6771ffe..1fc7656f85 100644 --- a/libafl/src/stages/concolic.rs +++ b/libafl/src/stages/concolic.rs @@ -96,7 +96,6 @@ use crate::stats::PerfFeature; fn generate_mutations(iter: impl Iterator) -> Vec> { use core::mem::size_of; use hashbrown::HashMap; - use std::convert::TryInto; use z3::{ ast::{Ast, Bool, Dynamic, BV}, Config, Context, Solver, Symbol, diff --git a/libafl/src/stats/mod.rs b/libafl/src/stats/mod.rs index 67be8b7b99..8ab9c389f8 100644 --- a/libafl/src/stats/mod.rs +++ b/libafl/src/stats/mod.rs @@ -12,8 +12,6 @@ use hashbrown::HashMap; #[cfg(feature = "introspection")] use alloc::string::ToString; -#[cfg(feature = "introspection")] -use core::convert::TryInto; use crate::bolts::current_time; diff --git a/libafl_cc/Cargo.toml b/libafl_cc/Cargo.toml index 77a11fda75..8c34aa1324 100644 --- a/libafl_cc/Cargo.toml +++ b/libafl_cc/Cargo.toml @@ -8,7 +8,7 @@ repository = "https://github.com/AFLplusplus/LibAFL/" readme = "../README.md" license = "MIT OR Apache-2.0" keywords = ["fuzzing", "testing", "compiler"] -edition = "2018" +edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/libafl_concolic/symcc_libafl/Cargo.toml b/libafl_concolic/symcc_libafl/Cargo.toml index 6fbd1aa93c..190bf8832d 100644 --- a/libafl_concolic/symcc_libafl/Cargo.toml +++ b/libafl_concolic/symcc_libafl/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "symcc_libafl" version = "0.1.0" -edition = "2018" +edition = "2021" authors = ["Julius Hohnerlein ", "Andrea Fioraldi ", "Dominik Maier "] description = "Meta package for symcc_runtime" documentation = "https://docs.rs/symcc_libafl" @@ -19,4 +19,4 @@ clone = ["which"] # common functionality to check out the symcc repo using git [dependencies] which = { version = "4.1", optional = true } -cmake = { version = "0.1", optional = true } \ No newline at end of file +cmake = { version = "0.1", optional = true } diff --git a/libafl_concolic/symcc_runtime/Cargo.toml b/libafl_concolic/symcc_runtime/Cargo.toml index 23804e9338..25aef24d70 100644 --- a/libafl_concolic/symcc_runtime/Cargo.toml +++ b/libafl_concolic/symcc_runtime/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "symcc_runtime" version = "0.1.2" -edition = "2018" +edition = "2021" authors = ["Julius Hohnerlein ", "Andrea Fioraldi ", "Dominik Maier "] description = "Build Concolic Tracing tools based on SymCC in Rust" documentation = "https://docs.rs/symcc_runtime" diff --git a/libafl_concolic/symcc_runtime/src/filter/coverage.rs b/libafl_concolic/symcc_runtime/src/filter/coverage.rs index fe511efd60..9c5ff9d2ee 100644 --- a/libafl_concolic/symcc_runtime/src/filter/coverage.rs +++ b/libafl_concolic/symcc_runtime/src/filter/coverage.rs @@ -1,6 +1,5 @@ use std::{ collections::hash_map::DefaultHasher, - convert::TryInto, hash::{BuildHasher, BuildHasherDefault, Hash, Hasher}, marker::PhantomData, }; diff --git a/libafl_concolic/test/dump_constraints/Cargo.toml b/libafl_concolic/test/dump_constraints/Cargo.toml index bfcf9feb71..d3b7ed985e 100644 --- a/libafl_concolic/test/dump_constraints/Cargo.toml +++ b/libafl_concolic/test/dump_constraints/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "dump_constraints" version = "0.1.0" -edition = "2018" +edition = "2021" authors = ["Julius Hohnerlein "] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] libafl = {path = "../../../libafl"} -structopt = "0.3.21" \ No newline at end of file +structopt = "0.3.21" diff --git a/libafl_concolic/test/runtime_test/Cargo.toml b/libafl_concolic/test/runtime_test/Cargo.toml index ada1df7088..e35b7a5a90 100644 --- a/libafl_concolic/test/runtime_test/Cargo.toml +++ b/libafl_concolic/test/runtime_test/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "runtime_test" version = "0.1.0" -edition = "2018" +edition = "2021" authors = ["Julius Hohnerlein "] [lib] diff --git a/libafl_derive/Cargo.toml b/libafl_derive/Cargo.toml index 42fd3d86e0..816ea2db74 100644 --- a/libafl_derive/Cargo.toml +++ b/libafl_derive/Cargo.toml @@ -8,7 +8,7 @@ repository = "https://github.com/AFLplusplus/LibAFL/" readme = "../README.md" license = "MIT OR Apache-2.0" keywords = ["fuzzing", "testing"] -edition = "2018" +edition = "2021" [lib] proc-macro = true diff --git a/libafl_frida/Cargo.toml b/libafl_frida/Cargo.toml index 57ef13b1fb..72cb0f7e8a 100644 --- a/libafl_frida/Cargo.toml +++ b/libafl_frida/Cargo.toml @@ -8,7 +8,7 @@ repository = "https://github.com/AFLplusplus/LibAFL/" readme = "../README.md" license = "MIT OR Apache-2.0" keywords = ["fuzzing", "frida", "instrumentation"] -edition = "2018" +edition = "2021" [features] diff --git a/libafl_qemu/Cargo.toml b/libafl_qemu/Cargo.toml index 49a438d339..226465d8ea 100644 --- a/libafl_qemu/Cargo.toml +++ b/libafl_qemu/Cargo.toml @@ -8,7 +8,7 @@ repository = "https://github.com/AFLplusplus/LibAFL/" readme = "../README.md" license = "MIT OR Apache-2.0" keywords = ["fuzzing", "qemu", "instrumentation"] -edition = "2018" +edition = "2021" [features] python = ["pyo3", "pyo3-build-config"] diff --git a/libafl_qemu/src/emu.rs b/libafl_qemu/src/emu.rs index 17733db5fb..90358b7960 100644 --- a/libafl_qemu/src/emu.rs +++ b/libafl_qemu/src/emu.rs @@ -2,7 +2,6 @@ use core::{ convert::Into, - convert::TryFrom, ffi::c_void, mem::{size_of, transmute, MaybeUninit}, ptr::{copy_nonoverlapping, null}, diff --git a/libafl_sugar/Cargo.toml b/libafl_sugar/Cargo.toml index 2a20ee201e..d16b5540cf 100644 --- a/libafl_sugar/Cargo.toml +++ b/libafl_sugar/Cargo.toml @@ -8,7 +8,7 @@ repository = "https://github.com/AFLplusplus/LibAFL/" readme = "../README.md" license = "MIT OR Apache-2.0" keywords = ["fuzzing"] -edition = "2018" +edition = "2021" build = "build.rs" [features] diff --git a/libafl_targets/Cargo.toml b/libafl_targets/Cargo.toml index 316bdeed8c..aebfb6c695 100644 --- a/libafl_targets/Cargo.toml +++ b/libafl_targets/Cargo.toml @@ -8,7 +8,7 @@ repository = "https://github.com/AFLplusplus/LibAFL/" readme = "../README.md" license = "MIT OR Apache-2.0" keywords = ["fuzzing", "testing"] -edition = "2018" +edition = "2021" [features] default = []