proptest 0.9.3

Hypothesis-like property-based testing and shrinking.
// Copyright 2017, 2018 The proptest developers
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
//> or the MIT license
// <LICENSE-MIT or>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

//! Arbitrary implementations for `std::mem`.

use core::mem::*;

use crate::strategy::statics::static_map;
use crate::arbitrary::*;

arbitrary!([A: Arbitrary] Discriminant<A>,
    SMapped<A, Self>, A::Parameters;
    args => static_map(any_with::<A>(args), |x| discriminant(&x))

lift1!(['static] Discriminant<A>;
    base => static_map(base, |x| discriminant(&x))

// Not supported at the moment since the user won't be able to call
// in any case so the use case is not great for this.

mod test {
    #[derive(Copy, Clone, Debug)]
    struct DummyStruct;
    arbitrary!(DummyStruct; DummyStruct);

        //manually_drop       => ManuallyDrop<u8>, // Trivial destructor.
        discriminant_struct => Discriminant<super::DummyStruct>,
        discriminant_enum   => Discriminant<::std::num::FpCategory>