about summary refs log tree commit diff
path: root/library/alloc/tests/vec.rs
diff options
context:
space:
mode:
Diffstat (limited to 'library/alloc/tests/vec.rs')
-rw-r--r--library/alloc/tests/vec.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/library/alloc/tests/vec.rs b/library/alloc/tests/vec.rs
index 81de7085e09..3d3175ba3a9 100644
--- a/library/alloc/tests/vec.rs
+++ b/library/alloc/tests/vec.rs
@@ -1213,6 +1213,14 @@ fn test_in_place_specialization_step_up_down() {
     assert_ne!(src_bytes, sink_bytes);
     assert_eq!(sink.len(), 2);
 
+    let mut src: Vec<[u8; 3]> = Vec::with_capacity(17);
+    src.resize( 8, [0; 3]);
+    let iter = src.into_iter().map(|[a, b, _]| [a, b]);
+    assert_in_place_trait(&iter);
+    let sink: Vec<[u8; 2]> = iter.collect();
+    assert_eq!(sink.len(), 8);
+    assert!(sink.capacity() <= 25);
+
     let src = vec![[0u8; 4]; 256];
     let srcptr = src.as_ptr();
     let iter = src