Rollup merge of #56713 - xfix:vec-test-zst-capacity, r=TimNN
Test capacity of ZST vector
Initially, #50233 accidentally changed the capacity of empty ZST. This was pointed out during code review. This commit adds a test to prevent capacity of ZST vectors from accidentally changing to prevent that from happening again.
diff --git a/src/liballoc/tests/vec.rs b/src/liballoc/tests/vec.rs
index e329b45..509195c 100644
--- a/src/liballoc/tests/vec.rs
+++ b/src/liballoc/tests/vec.rs
@@ -80,6 +80,11 @@
}
#[test]
+fn test_zst_capacity() {
+ assert_eq!(Vec::<()>::new().capacity(), usize::max_value());
+}
+
+#[test]
fn test_extend() {
let mut v = Vec::new();
let mut w = Vec::new();