File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 22
33// Checks that the compiler does not actually try to allocate 4 TB during compilation and OOM crash.
44
5- fn foo ( ) -> [ u8 ; 4 * 1024 * 1024 * 1024 * 1024 ] {
5+ #[ cfg( target_pointer_width = "64" ) ]
6+ const SIZE : usize = 4 * 1024 * 1024 * 1024 * 1024 ;
7+ #[ cfg( target_pointer_width = "32" ) ]
8+ const SIZE : usize = 2 * 1024 * 1024 * 1024 ;
9+
10+ fn foo ( ) -> [ u8 ; SIZE ] {
611 unimplemented ! ( )
712}
813
Original file line number Diff line number Diff line change 22
33// Checks that the compiler does not actually try to allocate 4 TB during compilation and OOM crash.
44
5+ #[ cfg( target_pointer_width = "64" ) ]
6+ const SIZE : usize = 4 * 1024 * 1024 * 1024 * 1024 ;
7+ #[ cfg( target_pointer_width = "32" ) ]
8+ const SIZE : usize = 2 * 1024 * 1024 * 1024 ;
9+
510fn main ( ) {
6- [ 0 ; 4 * 1024 * 1024 * 1024 * 1024 ] ;
11+ [ 0 ; SIZE ] ;
712}
You can’t perform that action at this time.
0 commit comments