This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +9
-7
lines changed Expand file tree Collapse file tree 3 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -2718,7 +2718,6 @@ ui/limits/issue-15919-32.rs
27182718ui/limits/issue-15919-64.rs
27192719ui/limits/issue-17913.rs
27202720ui/limits/issue-55878.rs
2721- ui/limits/issue-56762.rs
27222721ui/limits/issue-69485-var-size-diffs-too-large.rs
27232722ui/limits/issue-75158-64.rs
27242723ui/linkage-attr/auxiliary/issue-12133-dylib.rs
Original file line number Diff line number Diff line change 1- //@ only-x86_64
1+ //@ only-64bit
22
3- const HUGE_SIZE : usize = !0usize / 8 ;
3+ // This test validates we gracefully fail computing a const or static of absurdly large size.
4+ // The oddly-specific number is because of LLVM measuring object sizes in bits.
5+
6+ const HUGE_SIZE : usize = 1 << 61 ;
47
58
69pub struct TooBigArray {
Original file line number Diff line number Diff line change 11error[E0080]: could not evaluate static initializer
2- --> $DIR/issue-56762 .rs:16 :1
2+ --> $DIR/huge-static .rs:19 :1
33 |
44LL | static MY_TOO_BIG_ARRAY_1: TooBigArray = TooBigArray::new();
5- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ values of the type `[u8; 2305843009213693951 ]` are too big for the current architecture
5+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ values of the type `[u8; 2305843009213693952 ]` are too big for the current architecture
66
77error[E0080]: could not evaluate static initializer
8- --> $DIR/issue-56762 .rs:19 :1
8+ --> $DIR/huge-static .rs:22 :1
99 |
1010LL | static MY_TOO_BIG_ARRAY_2: [u8; HUGE_SIZE] = [0x00; HUGE_SIZE];
11- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ values of the type `[u8; 2305843009213693951 ]` are too big for the current architecture
11+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ values of the type `[u8; 2305843009213693952 ]` are too big for the current architecture
1212
1313error: aborting due to 2 previous errors
1414
You can’t perform that action at this time.
0 commit comments