We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
unchecked-index
1 parent aa8a67d commit 66f8bc7Copy full SHA for 66f8bc7
tests/unchecked-index.rs
@@ -0,0 +1,11 @@
1
+use unchecked_index::unchecked_index;
2
+
3
+#[test]
4
+fn unchecked_access() {
5
+ let mut xs = [0];
6
+ unsafe {
7
+ let mut xs = unchecked_index(&mut xs);
8
+ xs[0] += 1;
9
+ assert_eq!(xs[0], 1);
10
+ }
11
+}
0 commit comments