mirror of
				https://github.com/rust-lang/rust.git
				synced 2025-10-31 13:04:42 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			13 lines
		
	
	
		
			302 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			13 lines
		
	
	
		
			302 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
| //@ run-fail
 | |
| //@ error-pattern:capacity overflow
 | |
| //@ needs-subprocess
 | |
| 
 | |
| use std::collections::hash_map::HashMap;
 | |
| use std::mem::size_of;
 | |
| 
 | |
| fn main() {
 | |
|     let threshold = usize::MAX / size_of::<(u64, u64, u64)>();
 | |
|     let mut h = HashMap::<u64, u64>::with_capacity(threshold + 100);
 | |
|     h.insert(0, 0);
 | |
| }
 | 
