logo

Rust crates reviews

Cryptographically verifiable, distributed dependency reviews

crate: arrayvec

https://lib.rs/crates/arrayvec/

Add the last reviewed version to Cargo.toml / [dependencies]:

arrayvec = "0.7.2"

Filter reviews clicking on the numbers in the summary.

Full column names in tooltip hints: rating Negative, rating Neutral, rating Positive, rating Strong, thoroughness, understanding, reviews count.

Neg
Neu
Pos
Str
tho
und
rev
13
8
1
1
1
1
1
2
2
2
1
2
1
2
1
2
1
crate version
rating
date
reviewer
thoroughness, understanding
arrayvec 0.4.10
negative
2019-07-28
high, medium

Prefer 0.4.11 which at least starts using MaybeUninit instead of uninitialized!(), which is fundamentally unsound.
Uses a disturbing amount of unsafe, but aside from uninitialized, it all at least appears to be correct after a careful reading.
Unlike smallvec, this doesn't fall back on the heap.
Better than whatever you'll write rolling your own, at least.

0.4.7 -> 0.4.8: IntoIter implemented Clone, unconcerning
0.4.8 -> 0.4.9: ArrayString initialized to 0, ArrayVec uses nightly MaybeUninit. Unfortunately stable still uses uninitialized!() so this is still negative.
0.4.9 -> 0.4.10: #[repr(C)], -Clone for MaybeUninit. Apparently I missed more possible unsoundness. Unsafe is hard.

arrayvec 0.4.9
negative
2019-07-28
high, medium

Prefer 0.4.11 which at least starts using MaybeUninit instead of uninitialized!(), which is fundamentally unsound.
Uses a disturbing amount of unsafe, but aside from uninitialized, it all at least appears to be correct after a careful reading.
Unlike smallvec, this doesn't fall back on the heap.
Better than whatever you'll write rolling your own, at least.

0.4.7 -> 0.4.8: IntoIter implemented Clone, unconcerning
0.4.8 -> 0.4.9: ArrayString initialized to 0, ArrayVec uses nightly MaybeUninit. Unfortunately stable still uses uninitialized!() so this is still negative.

arrayvec 0.4.8
negative
2019-07-28
high, medium

Prefer 0.4.11 which at least starts using MaybeUninit instead of uninitialized!(), which is fundamentally unsound.
Uses a disturbing amount of unsafe, but aside from uninitialized, it all at least appears to be correct after a careful reading.
Unlike smallvec, this doesn't fall back on the heap.
Better than whatever you'll write rolling your own, at least.

See 0.4.7 for base review. Diffed 0.4.7 -> 0.4.8, no concerning changes.

arrayvec 0.4.7
negative
2019-07-28
high, medium

Prefer 0.4.11 which at least starts using MaybeUninit instead of uninitialized!(), which is fundamentally unsound.
Uses a disturbing amount of unsafe, but aside from uninitialized, it all at least appears to be correct after a careful reading.
Unlike smallvec, this doesn't fall back on the heap.
Better than whatever you'll write rolling your own, at least.

Detail

FileRatingNotes
benches/arraystring.rs+1
benches/extend.rs+1
src/array_string.rs0lots of unsafe, but I think sound
src/array.rs0fix_array_impl! hides unsafe, but not misused nor public
src/char.rs+1Relied upon for soundness... thoroughly checked against https://en.wikipedia.org/wiki/UTF-8
src/errors.rs+1
src/lib.rs0lots of unsafe, but I think sound
src/range.rs+1
tests/serde.rs+1
tests/tests.rs+1
.gitignore+1
.travis.yml+1
Cargo.toml+1
Cargo.toml.orig+1
custom.css+1
LICENSE-APACHE+1
LICENSE-MIT+1
README.rst+1
OtherRatingNotes
unsafe-1Overused
fs+1Unused
docs+1
tests0Good coverage... not seeing any fuzz testing for all this unsafe though.

src/array_string.rs

OK

LineNotes
56unsafe - new_array ~ uninitialized, Array is an unsafe trait though so only implement it if this is sound...?
95No CapacityError? Inconsistent vs from...
160unsafe { ... } - looks correct
213unsafe { ... } - looks correct
216could be a slice copy instead
245unsafe { ... } - looks correct
271unsafe { ... } - looks correct
307unsafe { ... } - looks correct
318unsafe { ... } - looks correct
331unsafe fn - decent docs, looks correct, should be more explicit about uninitialized though
342unsafe fn - needs better docs, but looks correct
351unsafe { ... } - looks correct
361unsafe { ... } - scary transmute, but just from &mut [u8] to &mut str. stdlib from_utf8_unchecked does equivalent pointer casts

src/array.rs

LineNotes
80Aieee!
132unsafe { ... } - not sure this is sound for bools etc.
214unsafe { ... } - looks correct
246unsafe fn - exactly as spceified
306unsafe { ... } - looks correct
340unsafe { ... } - looks correct
511unsafe fn - exactly as specified
552unsafe { ... } - scary as heck... but Drain should keep self borrowed long enough, at least.
575unsafe { ... } - looks correct
604unsafe { ... } - looks correct
614unsafe { ... } - looks correct
707unsafe { ... } - looks correct. Size could be reduced, relies on IntoIter's custom drop not dropping copied elements due to the index increment to avoid double drops.
724unsafe { ... } - looks correct. Size could be reduced, relies on IntoIter's custom drop not dropping copied elements due to the length decrement to avoid double drops.
740unsafe { ... } - looks correct. Implements the aforementioned IntoIter custom drop.
764unsafe Sync - I believe this is OK.
765unsafe Send - I believe this is OK.
775unsafe { ... } - looks correct. Relies on set_len already being truncated to avoid double drops.
793unsafe { ... } - looks correct. Relies on set_len already being truncated to avoid double drops.
809necessary to aovid memory leaks
812unsafe { ... } - looks correct.
851unsafe { ... } - looks correct.
1008unsafe { ... } - looks correct.

© bestia.dev 2023, MIT License, Version: 2023.608.1636

Open source repository for this web app: https://github.com/bestia-dev/cargo_crev_web/