Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'Rng.gen_range called with low >= high' #83

Closed
twittner opened this issue Jul 20, 2015 · 1 comment
Closed

'Rng.gen_range called with low >= high' #83

twittner opened this issue Jul 20, 2015 · 1 comment

Comments

@twittner
Copy link

This can happen due to invalid casts from quickcheck::Gen::size of type usize to various other integer types with a value range smaller than usize (cf. quickcheck::arbitrary::unsigned_arbitrary).

Test case:

#[test]
fn test() {
    fn prop(_: u8) -> bool { true }

    QuickCheck::new()
        .gen(StdGen::new(rand::thread_rng(), 1024))
        .quickcheck(prop as fn(u8) -> bool)
}
@BurntSushi
Copy link
Owner

Thanks for the report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants