We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 57d66a0 commit 0c61038Copy full SHA for 0c61038
vortex-buffer/src/buffer.rs
@@ -741,4 +741,16 @@ mod test {
741
assert!(buff.is_aligned(Alignment::of::<i32>()));
742
assert_eq!(vec, buff);
743
}
744
+
745
+ #[test]
746
+ fn test_slice_unaligned_end_pos() {
747
+ let data = vec![0u8; 2];
748
+ // Overalign the u8 vector.
749
+ let aligned_buffer = Buffer::copy_from_aligned(&data, Alignment::new(8));
750
+ // Previously, `Buffer::slice` incorrectly asserted that the end position
751
+ // must be aligned. That assertion has been removed such that the end
752
+ // position can be arbitrary and only the beginning of the slice needs
753
+ // to be aligned.
754
+ aligned_buffer.slice(0..1);
755
+ }
756
0 commit comments