]> git.lizzy.rs Git - rust.git/blob - src/test/run-fail/hashmap-capacity-overflow.rs
Use better bound names in `-Zverbose` mode
[rust.git] / src / test / run-fail / hashmap-capacity-overflow.rs
1 // error-pattern:capacity overflow
2
3 use std::collections::hash_map::HashMap;
4 use std::usize;
5 use std::mem::size_of;
6
7 fn main() {
8     let threshold = usize::MAX / size_of::<(u64, u64, u64)>();
9     let mut h = HashMap::<u64, u64>::with_capacity(threshold + 100);
10     h.insert(0, 0);
11 }