Skip to content

Commit babae41

Browse files
committed
DOC: Add safety documentation on Array trait
1 parent ba4d98c commit babae41

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/array.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,15 @@
1212
/// (a few in this range are included by default).
1313
/// - `array-sizes-129-255`: All sizes 129 to 255 are implemented
1414
/// (a few in this range are included by default).
15+
///
16+
/// ## Safety
17+
///
18+
/// If implemented, this trait can only be implmented by fixed-size arrays or
19+
/// types with exactly the representation of a fixed size array (of the right
20+
/// element type and capacity).
21+
///
22+
/// Normally this trait is an implementation detail of arrayvec and doesn't
23+
/// need implementing.
1524
pub unsafe trait Array {
1625
/// The array’s element type
1726
type Item;

0 commit comments

Comments
 (0)