]> git.lizzy.rs Git - rust.git/blob - src/test/ui/hashmap/hashmap-capacity-overflow.rs
Update tests to remove old numeric constants
[rust.git] / src / test / ui / hashmap / hashmap-capacity-overflow.rs
1 // run-fail
2 // error-pattern:capacity overflow
3 // ignore-emscripten no processes
4
5 use std::collections::hash_map::HashMap;
6 use std::mem::size_of;
7
8 fn main() {
9     let threshold = usize::MAX / size_of::<(u64, u64, u64)>();
10     let mut h = HashMap::<u64, u64>::with_capacity(threshold + 100);
11     h.insert(0, 0);
12 }