]>
git.proxmox.com Git - rustc.git/blob - vendor/proptest/src/arbitrary/_core/mem.rs
2 // Copyright 2017, 2018 The proptest developers
4 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
5 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
6 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
7 // option. This file may not be copied, modified, or distributed
8 // except according to those terms.
10 //! Arbitrary implementations for `std::mem`.
14 use crate::arbitrary
::*;
15 use crate::strategy
::statics
::static_map
;
17 arbitrary
!([A
: Arbitrary
] Discriminant
<A
>,
18 SMapped
<A
, Self>, A
::Parameters
;
19 args
=> static_map(any_with
::<A
>(args
), |x
| discriminant(&x
))
22 lift1
!(['
static] Discriminant
<A
>;
23 base
=> static_map(base
, |x
| discriminant(&x
))
26 // Not supported at the moment since the user won't be able to call
27 // https://doc.rust-lang.org/nightly/std/mem/union.ManuallyDrop.html#method.drop
28 // in any case so the use case is not great for this.
29 //wrap_ctor!(ManuallyDrop);
33 #[derive(Copy, Clone, Debug)]
35 arbitrary
!(DummyStruct
; DummyStruct
);
38 //manually_drop => ManuallyDrop<u8>, // Trivial destructor.
39 discriminant_struct
=> Discriminant
<super::DummyStruct
>,
40 discriminant_enum
=> Discriminant
<::std
::num
::FpCategory
>