Skip to content

Commit

Permalink
Merge pull request #147 from sunsided/feature/fail-compile
Browse files Browse the repository at this point in the history
Add a compile_fail test for mandatory fields
  • Loading branch information
idanarye authored Jun 15, 2024
2 parents 20f59ae + 3f5616c commit 4e59ac8
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,19 @@ impl<T> Optional<T> for (T,) {
// crate is all we can use.

#[doc(hidden)]
/// When a property is non-default, you can't ignore it:
///
/// ```compile_fail
/// use typed_builder::TypedBuilder;
///
/// #[derive(TypedBuilder)]
/// struct Foo {
/// x: i8,
/// }
///
/// let _ = Foo::builder().build();
/// ```
///
/// When a property is skipped, you can't set it:
/// (“method `y` not found for this”)
///
Expand Down

0 comments on commit 4e59ac8

Please sign in to comment.