mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
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.
This commit is contained in:
parent
128a1fa4e1
commit
1006425769
@ -79,6 +79,11 @@ fn test_reserve() {
|
||||
assert!(v.capacity() >= 33)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_zst_capacity() {
|
||||
assert_eq!(Vec::<()>::new().capacity(), usize::max_value());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_extend() {
|
||||
let mut v = Vec::new();
|
||||
|
Loading…
Reference in New Issue
Block a user