File tree 2 files changed +12
-2
lines changed
2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 2
2
3
3
// Checks that the compiler does not actually try to allocate 4 TB during compilation and OOM crash.
4
4
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 ] {
6
11
unimplemented ! ( )
7
12
}
8
13
Original file line number Diff line number Diff line change 2
2
3
3
// Checks that the compiler does not actually try to allocate 4 TB during compilation and OOM crash.
4
4
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
+
5
10
fn main ( ) {
6
- [ 0 ; 4 * 1024 * 1024 * 1024 * 1024 ] ;
11
+ [ 0 ; SIZE ] ;
7
12
}
You can’t perform that action at this time.
0 commit comments