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
2718
2718
ui/limits/issue-15919-64.rs
2719
2719
ui/limits/issue-17913.rs
2720
2720
ui/limits/issue-55878.rs
2721
- ui/limits/issue-56762.rs
2722
2721
ui/limits/issue-69485-var-size-diffs-too-large.rs
2723
2722
ui/limits/issue-75158-64.rs
2724
2723
ui/linkage-attr/auxiliary/issue-12133-dylib.rs
Original file line number Diff line number Diff line change 1
- //@ only-x86_64
1
+ //@ only-64bit
2
2
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 ;
4
7
5
8
6
9
pub struct TooBigArray {
Original file line number Diff line number Diff line change 1
1
error[E0080]: could not evaluate static initializer
2
- --> $DIR/issue-56762 .rs:16 :1
2
+ --> $DIR/huge-static .rs:19 :1
3
3
|
4
4
LL | 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
6
6
7
7
error[E0080]: could not evaluate static initializer
8
- --> $DIR/issue-56762 .rs:19 :1
8
+ --> $DIR/huge-static .rs:22 :1
9
9
|
10
10
LL | 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
12
12
13
13
error: aborting due to 2 previous errors
14
14
You can’t perform that action at this time.
0 commit comments