Skip to content

Commit

Permalink
[Book] Derive : update proptest-derive to avoid talking about GATs an…
Browse files Browse the repository at this point in the history
…d just refer users to the issue tracker for Strategies of non-owned types
  • Loading branch information
matthew-russo committed Sep 22, 2024
1 parent f8a84d5 commit 47096c6
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions book/src/proptest-derive/errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,13 @@ struct Foo<'a> {
}
```

[gats]: https://github.com/rust-lang/rust/issues/44265
[issue#9]: https://github.com/proptest-rs/proptest/issues/9

Due to the lack of *[generic associated types (GATs)][gats]* on stable Rust,
it is currently impossible to define a `Strategy` which generates a type
that is lifetime-generic (e.g. `&'a T`). Thus, proptest cannot implement
`Arbitrary` for such types either and therefore you cannot `#[derive(Arbitrary)]`
for such types. Once GATs are available, we will try to lift this restriction.
To follow the progress, consult the [tracking issue][issue#9] on the matter.
It is not yet possible to define a `Strategy` which generates a type that is
lifetime-generic (e.g. `&'a T`). Thus, proptest cannot implement `Arbitrary` for
such types either and therefore you cannot `#[derive(Arbitrary)]` for such types.
GATs are available in stable rust as of 1.65 and we will be revisiting how to support
this. To follow the progress, consult the [tracking issue][issue#9] on the matter.

## E0002

Expand Down

0 comments on commit 47096c6

Please sign in to comment.