-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-runtimeArea: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflowsArea: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflowsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Description
There should be some sort of seedable implementation of rand::rng so that sequences of random operations can be easily reproduced.
The gen_* methods in the rand::rng iface should be separated out into an iface-less implementation for the rand::rng iface-type, i.e.:
impl gen for rng {
fn gen_str (len: uint) -> str { ... }
....
}
This will allow multiple implementations of the rand::rng iface to use the gen_* methods.
There should be more gen_* methods available, for example:
- there should be one for each primitive integer/float type
- there should be shuffle-vector, choose-from-vector, choose-from-weighted-vector methods
- the functions from /src/fuzzer/rand_util.rs should become gen_methods
Motivation
I have been writing a fuzzer and I would have found these things useful to have in the core/std library.
Metadata
Metadata
Assignees
Labels
A-runtimeArea: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflowsArea: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflowsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.