Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit d6383b4

Browse files
bless issue-56762.rs as huge-static.rs
1 parent 42dbf29 commit d6383b4

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

src/tools/tidy/src/issues.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2718,7 +2718,6 @@ ui/limits/issue-15919-32.rs
27182718
ui/limits/issue-15919-64.rs
27192719
ui/limits/issue-17913.rs
27202720
ui/limits/issue-55878.rs
2721-
ui/limits/issue-56762.rs
27222721
ui/limits/issue-69485-var-size-diffs-too-large.rs
27232722
ui/limits/issue-75158-64.rs
27242723
ui/linkage-attr/auxiliary/issue-12133-dylib.rs

tests/ui/limits/issue-56762.rs renamed to tests/ui/limits/huge-static.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
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

69
pub struct TooBigArray {

tests/ui/limits/issue-56762.stderr renamed to tests/ui/limits/huge-static.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
error[E0080]: could not evaluate static initializer
2-
--> $DIR/issue-56762.rs:16:1
2+
--> $DIR/huge-static.rs:19:1
33
|
44
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
66

77
error[E0080]: could not evaluate static initializer
8-
--> $DIR/issue-56762.rs:19:1
8+
--> $DIR/huge-static.rs:22:1
99
|
1010
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
1212

1313
error: aborting due to 2 previous errors
1414

0 commit comments

Comments
 (0)