Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 1 addition & 1 deletion proptest-derive/src/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
}

Expand Down
2 changes: 2 additions & 0 deletions proptest/src/num.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::*;
Expand Down Expand Up @@ -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::*;
Expand Down
14 changes: 9 additions & 5 deletions proptest/src/test_runner/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,16 +153,20 @@ pub trait ProptestResultExt<T, E>: 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
Expand Down