Skip to content

Commit

Permalink
bump MSRV to 1.66.0 (#218)
Browse files Browse the repository at this point in the history
  • Loading branch information
camshaft authored May 30, 2024
1 parent f91cc10 commit 04e6a5b
Show file tree
Hide file tree
Showing 16 changed files with 24 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
strategy:
fail-fast: false
matrix:
rust: [1.57.0, stable, nightly]
rust: ['1.66.0', stable, nightly]
os: [ubuntu-latest, macOS-latest]

steps:
Expand Down
2 changes: 1 addition & 1 deletion bin/cargo-bolero/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ keywords = ["testing", "quickcheck", "property", "fuzz", "fuzzing"]
license = "MIT"
edition = "2018"
readme = "README.md"
rust-version = "1.66.0"
rust-version = "1.76.0"

[features]
default = ["afl", "libfuzzer", "kani"]
Expand Down
2 changes: 1 addition & 1 deletion bin/cargo-bolero/src/manifest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ impl Package {
pub fn resolve(manifest_path: Option<&str>, package: Option<&str>) -> Result<Self> {
Metadata::from_manifest_path(manifest_path)?
.resolve_package(package)
.map(|package| package.clone())
.cloned()
}

pub fn manifest_dir(&self) -> PathBuf {
Expand Down
1 change: 1 addition & 0 deletions bin/clippy.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
msrv = "1.76.0"
2 changes: 1 addition & 1 deletion bin/rust-toolchain
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "1.66.0"
channel = "1.73.0"
components = [ "rustc", "clippy", "rustfmt" ]
2 changes: 1 addition & 1 deletion clippy.toml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
msrv = "1.30.0"
msrv = "1.66.0"
2 changes: 1 addition & 1 deletion lib/bolero-engine/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ keywords = ["testing", "quickcheck", "property", "fuzz", "fuzzing"]
license = "MIT"
edition = "2018"
readme = "../../README.md"
rust-version = "1.57.0"
rust-version = "1.66.0"

[features]
rng = ["rand", "rand_xoshiro", "bolero-generator/alloc"]
Expand Down
4 changes: 2 additions & 2 deletions lib/bolero-engine/src/panic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ macro_rules! backtrace {
}

thread_local! {
static ERROR: RefCell<Option<PanicError>> = RefCell::new(None);
static ERROR: RefCell<Option<PanicError>> = const { RefCell::new(None) };
static CAPTURE_BACKTRACE: RefCell<bool> = RefCell::new(*RUST_BACKTRACE);
static FORWARD_PANIC: RefCell<bool> = RefCell::new(true);
static FORWARD_PANIC: RefCell<bool> = const { RefCell::new(true) };
static THREAD_NAME: String = String::from(std::thread::current().name().unwrap_or("main"));
}

Expand Down
2 changes: 1 addition & 1 deletion lib/bolero-engine/src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ where
let value = core::panic::AssertUnwindSafe(generate_value!(self, driver));

panic::catch(|| {
let res = (fun)(*value);
let res = (fun)(&value);
match res.into_test_result() {
Ok(()) => Ok(true),
Err(err) => Err(err),
Expand Down
2 changes: 1 addition & 1 deletion lib/bolero-generator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ keywords = ["testing", "quickcheck", "property", "fuzz", "fuzzing"]
license = "MIT"
edition = "2021"
readme = "README.md"
rust-version = "1.57.0"
rust-version = "1.66.0"

[features]
default = ["either", "std"]
Expand Down
5 changes: 2 additions & 3 deletions lib/bolero-generator/src/driver/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,10 @@ macro_rules! gen_from_bytes {
#[inline]
fn gen_bool(&mut self, probability: Option<f32>) -> Option<bool> {
if let Some(probability) = probability {
let value = self.gen_u32(Bound::Unbounded, Bound::Unbounded)? as f32
/ core::u32::MAX as f32;
let value = u32::sample_unbound(self)? as f32 / core::u32::MAX as f32;
Some(value < probability)
} else {
let value: u8 = self.gen_u8(Bound::Unbounded, Bound::Unbounded)?;
let value = u8::sample_unbound(self)?;
Some(value < (u8::MAX / 2))
}
}
Expand Down
12 changes: 7 additions & 5 deletions lib/bolero-generator/src/uniform.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,8 @@ impl Uniform for char {

#[cfg(test)]
mod tests {
#![allow(clippy::redundant_closure_call)]

use super::*;
use core::fmt;

Expand Down Expand Up @@ -343,19 +345,19 @@ mod tests {
driver_mode: DriverMode,
map: impl Fn(u8, u8) -> (Bound<T>, Bound<T>),
) {
for min in 0..=255 {
for max in 0..=255 {
let (min_b, max_b) = map(min, max);
for min in 0..=T::ENTRIES {
for max in 0..=T::ENTRIES {
let (min_b, max_b) = map(min as _, max as _);
let mut expected = Seen::default();
T::fill_expected(min_b, max_b, &mut expected);

let min_b = BoundExt::as_ref(&min_b);
let max_b = BoundExt::as_ref(&max_b);

let mut actual = Seen::default();
for seed in 0..=255 {
for seed in 0..=T::ENTRIES {
let mut driver = Byte {
value: Some(seed),
value: Some(seed as _),
driver_mode,
};
let result = T::sample(&mut driver, min_b, max_b);
Expand Down
2 changes: 1 addition & 1 deletion lib/bolero/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ keywords = ["testing", "quickcheck", "property", "fuzz", "fuzzing"]
license = "MIT"
edition = "2018"
readme = "../../README.md"
rust-version = "1.57.0"
rust-version = "1.66.0"

[features]
default = ["std"]
Expand Down
2 changes: 1 addition & 1 deletion lib/bolero/src/test/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ impl TestEngine {
T::Value: core::fmt::Debug,
{
let mut file_options = options.clone();
let mut rng_options = options.clone();
let mut rng_options = options;

// set the driver mode to direct for file replays since they were likely generated with
// fuzzers
Expand Down
1 change: 1 addition & 0 deletions lib/clippy.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
msrv = "1.66.0"
2 changes: 1 addition & 1 deletion lib/rust-toolchain
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "1.57.0"
channel = "1.66.0"
components = [ "rustc", "clippy", "rustfmt" ]

0 comments on commit 04e6a5b

Please sign in to comment.