File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -96,6 +96,25 @@ use std::sync::{Arc, Mutex};
96
96
///
97
97
/// Every member of the `struct` or `enum` must also implement `Arbitrary`.
98
98
///
99
+ /// It is also possible to change the default bounds added by the derive:
100
+ ///
101
+ /// ```
102
+ /// # #[cfg(feature = "derive")] mod foo {
103
+ /// use arbitrary::Arbitrary;
104
+ ///
105
+ /// trait Trait {
106
+ /// type Assoc: for<'a> Arbitrary<'a>;
107
+ /// }
108
+ ///
109
+ /// #[derive(Arbitrary)]
110
+ /// // The bounds are used verbatim, so any existing trait bounds will need to be repeated.
111
+ /// #[arbitrary(bound = "T: Trait")]
112
+ /// struct Point<T: Trait> {
113
+ /// x: T::Assoc,
114
+ /// }
115
+ /// # }
116
+ /// ```
117
+ ///
99
118
/// # Implementing `Arbitrary` By Hand
100
119
///
101
120
/// Implementing `Arbitrary` mostly involves nested calls to other `Arbitrary`
You can’t perform that action at this time.
0 commit comments