Skip to content

Commit b1fd2a5

Browse files
committed
Use edition 2024
1 parent 3de915d commit b1fd2a5

File tree

6 files changed

+18
-13
lines changed

6 files changed

+18
-13
lines changed

afl/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ authors = [
1010
description = "Fuzzing Rust code with american-fuzzy-lop"
1111
repository = "https://github.com/rust-fuzz/afl.rs"
1212
homepage = "https://github.com/rust-fuzz/afl.rs"
13-
edition = "2021"
13+
edition = "2024"
1414
exclude = ["etc"]
1515

1616
[build-dependencies]

afl/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use std::io::{self, Read};
1010
use std::panic;
1111

1212
// those functions are provided by the afl-llvm-rt static library
13-
extern "C" {
13+
unsafe extern "C" {
1414
fn __afl_persistent_loop(counter: usize) -> isize;
1515
fn __afl_manual_init();
1616

@@ -20,7 +20,7 @@ extern "C" {
2020

2121
#[allow(non_upper_case_globals)]
2222
#[doc(hidden)]
23-
#[no_mangle]
23+
#[unsafe(no_mangle)]
2424
pub static mut __afl_sharedmem_fuzzing: i32 = 1;
2525

2626
/// Fuzz a closure by passing it a `&[u8]`

cargo-afl/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ authors = [
1111
description = "Fuzzing Rust code with american-fuzzy-lop"
1212
repository = "https://github.com/rust-fuzz/afl.rs"
1313
homepage = "https://github.com/rust-fuzz/afl.rs"
14-
edition = "2021"
14+
edition = "2024"
1515
exclude = ["etc"]
1616

1717
[build-dependencies]

cargo-afl/build.rs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,18 @@ fn main() {
1616
let building_on_docs_rs = env::var("DOCS_RS").is_ok();
1717

1818
// smoelius: Build AFLplusplus only when installing and not building on docs.rs.
19-
if installing && !building_on_docs_rs {
20-
if let Err(error) = config::config(&config::Args {
19+
if installing
20+
&& !building_on_docs_rs
21+
&& let Err(error) = config::config(&config::Args {
2122
build: true,
2223
force: true,
2324
plugins: cfg!(feature = "plugins"),
2425
..Default::default()
25-
}) {
26-
println!(
27-
"cargo:warn=Could not build AFLplusplus; it will need to be built manually with \
26+
})
27+
{
28+
println!(
29+
"cargo:warn=Could not build AFLplusplus; it will need to be built manually with \
2830
`cargo afl config --build`: {error}"
29-
);
30-
}
31+
);
3132
}
3233
}

cargo-afl/src/main.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,9 @@ where
333333
if no_cfg_fuzzing {
334334
rustflags.push_str("--cfg no_fuzzing ");
335335
// afl-fuzz is sensitive to AFL_ env variables. Let's remove this particular one - it did it's job
336-
env::remove_var("AFL_NO_CFG_FUZZING");
336+
unsafe {
337+
env::remove_var("AFL_NO_CFG_FUZZING");
338+
}
337339
} else {
338340
rustflags.push_str("--cfg fuzzing ");
339341
}

cargo-afl/tests/crates_io.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ const BUILD_MSGS: &[&str] = &[
1010

1111
#[ctor::ctor]
1212
fn init() {
13-
env::set_var("CARGO_TERM_COLOR", "never");
13+
unsafe {
14+
env::set_var("CARGO_TERM_COLOR", "never");
15+
}
1416
}
1517

1618
#[test]

0 commit comments

Comments
 (0)