Conversation
89f6bf2 to
18dbde2
Compare
| let _ = vec.reserve(safe_additional); | ||
| } | ||
| SoAVecOp::Get { index } => { | ||
| let _ = vec.get(*index); // Test bounds checking in get() |
There was a problem hiding this comment.
suggestion: You could maybe use something like black_box on the reference to ensure the compiler doesn't optimise this down to nothing. Also consider dereferencing the value here and putting that into black_box go confirm reading works. Do the same for mut side, but there if possible also write a value through the mut reference.
18dbde2 to
63144ee
Compare
115768c to
c8a8528
Compare
|
Ok! So I've just maybe cleaned up the code a little and added black boxes. #[derive(Arbitrary, Debug)]
struct MyStruct<'a> {
name: Cow<'a, str>,
}And for the custom Drop implementation structs i don't think there is a way unless the whole struct is very simple as in a struct that only has Copy types. Is this what you wanted? |
Hmm... I could imagine eg. creating some static array of values of type T, and then randomly generating an index into that array and borrowing that index from the array, and thus generate
I was thinking of something like using So for the Vec part an example would be: struct SoableVec<T> {
ptr: *mut T,
length: usize,
capacity: usize,
}You get those fields from |
|
LGTM, nice work! <3 |
Still needs to fuzz some structs with Drop implementation before review.