Skip to content

Commit

Permalink
Merge pull request #175 from benluelo/arbitrary-bound-attribute
Browse files Browse the repository at this point in the history
docs: mention `arbitrary(bound = "...")` container attribute in trait docs
  • Loading branch information
fitzgen authored Jan 29, 2024
2 parents 37ccb7d + 8471f01 commit 803f2df
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,25 @@ use std::sync::{Arc, Mutex};
///
/// Every member of the `struct` or `enum` must also implement `Arbitrary`.
///
/// It is also possible to change the default bounds added by the derive:
///
/// ```
/// # #[cfg(feature = "derive")] mod foo {
/// use arbitrary::Arbitrary;
///
/// trait Trait {
/// type Assoc: for<'a> Arbitrary<'a>;
/// }
///
/// #[derive(Arbitrary)]
/// // The bounds are used verbatim, so any existing trait bounds will need to be repeated.
/// #[arbitrary(bound = "T: Trait")]
/// struct Point<T: Trait> {
/// x: T::Assoc,
/// }
/// # }
/// ```
///
/// # Implementing `Arbitrary` By Hand
///
/// Implementing `Arbitrary` mostly involves nested calls to other `Arbitrary`
Expand Down

0 comments on commit 803f2df

Please sign in to comment.