diff --git a/Cargo.toml b/Cargo.toml index ca4ffb62..2b8a435b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -33,8 +33,8 @@ rand_xorshift = "0.4" regex = "1.0" regex-syntax = "0.8" rusty-fork = { version = "0.3.0", default-features = false } -syn = "2.0.100" +syn = "2.0.108" tempfile = "3.0" -trybuild = "=1.0.90" +trybuild = "=1.0.112" unarray = "0.1.4" x86 = "0.52.0" diff --git a/proptest-derive/src/ast.rs b/proptest-derive/src/ast.rs index d1253fb7..39f3a393 100644 --- a/proptest-derive/src/ast.rs +++ b/proptest-derive/src/ast.rs @@ -825,7 +825,7 @@ impl ToTokens for MapClosure { /// Construct a `FreshVar` with the given `prefix` and the number it has in the /// count of temporaries for that prefix. -fn fresh_var(prefix: &str, count: usize) -> FreshVar { +fn fresh_var(prefix: &str, count: usize) -> FreshVar<'_> { FreshVar { prefix, count } } diff --git a/proptest/src/num.rs b/proptest/src/num.rs index 55761ecc..2b67b514 100644 --- a/proptest/src/num.rs +++ b/proptest/src/num.rs @@ -238,6 +238,7 @@ macro_rules! signed_integer_bin_search { ($typ:ident, $int_any: ident, $uniform: ident, $incl: ident) => { #[allow(missing_docs)] pub mod $typ { + #[allow(unused_imports)] use rand::{Rng, RngCore}; use crate::strategy::*; @@ -343,6 +344,7 @@ macro_rules! unsigned_integer_bin_search { ($typ:ident, $int_any: ident, $uniform: ident, $incl: ident) => { #[allow(missing_docs)] pub mod $typ { + #[allow(unused_imports)] use rand::{Rng, RngCore}; use crate::strategy::*; diff --git a/proptest/src/test_runner/errors.rs b/proptest/src/test_runner/errors.rs index 7dc2a434..c325e1c4 100644 --- a/proptest/src/test_runner/errors.rs +++ b/proptest/src/test_runner/errors.rs @@ -153,16 +153,20 @@ pub trait ProptestResultExt: private::Sealed { /// /// ``` /// use proptest::prelude::*; - /// proptest! { - /// #[test] - /// fn test_that_only_works_with_positive_integers(a in -10i32..10i32) { + /// + /// fn test_conversion(a: i32) -> Result<(), TestCaseError> { /// // Reject the case if `a` cannot be converted to u8 (e.g., negative values) /// let _unsigned: u8 = a.try_into().prop_assume_ok()?; /// // ...rest of test... + /// Ok(()) + /// } + /// + /// proptest! { + /// #[test] + /// fn test_that_only_works_with_positive_integers(a in -10i32..10i32) { + /// test_conversion(a)?; /// } /// } - /// # - /// # fn main() { test_signed_to_unsigned(); } /// ``` /// /// [`prop_assume!`]: crate::prop_assume