Comments (4)
It’d be lovely to revisit this issue now that GATs have been stabilized. Has anybody experimented with it? :)
EDIT: A bit about my use case: Due to proptest not supporting non-owned types, I’m unable to randomly generate a tree value whose nodes are allocated in an arena (bumpalo) because I can’t store &Child
references in the node type. I’m forced to allocate with Box::new()
and Vec<>
to create the nodes.
from proptest.
I do think it'd be useful, but I also agree that this definitely requires GATs. (If trait aliases become a thing, there might also be a viable option of just adding a lifetime parameter to all the traits that most people wouldn't have to deal with.)
I think the problem bears a lot of similarity to "streaming iterators", so it might be best to wait and see how that gets solved and then follow suit.
from proptest.
Agreed, it is similar to streaming iterators. Once GATs lands I will do some prototyping on nightly to see how much the interface has to change to accommodate generation of borrowed types and how much we have to modify the strategies already provided.
If we find a good solution we can perhaps develop it as a separate branch and then merge it in once GATs for lifetimes are stabilized (which might be before GATs for types).
from proptest.
Hmm while GATs may be the correct way to represent this, they look unlikely to be stabilized anytime soon, and I'm curious as to why this wouldn't work if Strategy
and ValueTree
were simply generic on 'a
.
It feels to me it would work, with ValueTree
holding the owned data and generating the non-owned structures on call to current
. current
on ValueTree
would take &'a self
.
We would always implement ValueTree
and Strategy
for every 'a
and use for<'a> T: Strategy<'a>
wherever required.
from proptest.
Related Issues (20)
- First-class support for async functions
- The type 'EasyCashIdentity.EntityLayer.Concrete.AppUser' cannot be used as type parameter
- rust-analyzer doesn't like the derive(Arbitrary) generated code for enums HOT 1
- Zero Examples of `impl Arbitrary` ? HOT 3
- Finite state machines HOT 1
- proptest_derive triggers non-local impl nightly warning HOT 1
- Update "shrinks to" comment on the same seed failures HOT 1
- Panic on empty ranges during strategy creation HOT 3
- Don't require `Arbitrary::Parameters` to implement `Default` HOT 4
- Recursive `arbitrary` calls HOT 3
- Change verbosity of shrink disabled and persisted failure messages HOT 3
- Provide access to state for (debug) printing transitions HOT 5
- feat: add option to interrupt test runner HOT 2
- derive macro for Arbitrary is hard to find HOT 4
- Attribute macro #[property_test] available in docs, but undocumented and behind undocumented feature HOT 1
- Lift MSRV to 1.70 to relax dependency on trybuild
- RangeInclusive of floats containing one element panics
- Improve logging for state machine testing
- The ` state_machine_echo_server` example does not compile HOT 2
- Proptest logging
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from proptest.