froggy
froggy copied to clipboard
Is this unsound?
These no-bounds-checking indexing operations on Storage: https://github.com/kvark/froggy/blob/master/src/lib.rs#L252-L269
I get that they're only so on release, but I'd expect the bounds checking to also happen on release by default (As is common in rust). Maybe a flag to disable it would make more sense
Sure looks unsound to me. I think this was your example from Discord:
let mut storage = froggy::Storage::new();
let ptr1 = storage.create(1i32);
storage[&ptr1] = 2i32;
let mut storage2 = froggy::Storage::new();
storage2[&ptr1] = 2i32;
Yes, you are correct. We should keep the checks.