Skip to content

Commit fdde64a

Browse files
lauraltjiangliu
authored andcommitted
document panic for VolatileArrayRef::ref_at
We had a panic condition in volatile_memory which wasn't properly documented. Signed-off-by: Laura Loghin <[email protected]>
1 parent 142fc05 commit fdde64a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/volatile_memory.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1133,6 +1133,10 @@ where
11331133
}
11341134

11351135
/// Does a volatile read of the element at `index`.
1136+
///
1137+
/// # Panics
1138+
///
1139+
/// Panics if `index` is less than the number of elements of the array to which `&self` points.
11361140
pub fn ref_at(&self, index: usize) -> VolatileRef<'a, T, B> {
11371141
assert!(index < self.nelem);
11381142
// Safe because the memory has the same lifetime and points to a subset of the

0 commit comments

Comments
 (0)