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 (#505)
  • Loading branch information
matthew-russo authored Sep 22, 2024
1 parent f8a84d5 commit a3cc4a5
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 a3cc4a5

Please sign in to comment.