From d6383b4605856394ef839b82c9dec5c4d0b67e3c Mon Sep 17 00:00:00 2001 From: Jubilee Young Date: Tue, 9 Jul 2024 19:08:30 -0700 Subject: [PATCH] bless issue-56762.rs as huge-static.rs --- src/tools/tidy/src/issues.txt | 1 - tests/ui/limits/{issue-56762.rs => huge-static.rs} | 7 +++++-- .../ui/limits/{issue-56762.stderr => huge-static.stderr} | 8 ++++---- 3 files changed, 9 insertions(+), 7 deletions(-) rename tests/ui/limits/{issue-56762.rs => huge-static.rs} (65%) rename tests/ui/limits/{issue-56762.stderr => huge-static.stderr} (72%) diff --git a/src/tools/tidy/src/issues.txt b/src/tools/tidy/src/issues.txt index 8197a1bd859..e568f11db59 100644 --- a/src/tools/tidy/src/issues.txt +++ b/src/tools/tidy/src/issues.txt @@ -2718,7 +2718,6 @@ ui/limits/issue-15919-32.rs ui/limits/issue-15919-64.rs ui/limits/issue-17913.rs ui/limits/issue-55878.rs -ui/limits/issue-56762.rs ui/limits/issue-69485-var-size-diffs-too-large.rs ui/limits/issue-75158-64.rs ui/linkage-attr/auxiliary/issue-12133-dylib.rs diff --git a/tests/ui/limits/issue-56762.rs b/tests/ui/limits/huge-static.rs similarity index 65% rename from tests/ui/limits/issue-56762.rs rename to tests/ui/limits/huge-static.rs index 17b3ad8b01e..4709b46e59d 100644 --- a/tests/ui/limits/issue-56762.rs +++ b/tests/ui/limits/huge-static.rs @@ -1,6 +1,9 @@ -//@ only-x86_64 +//@ only-64bit -const HUGE_SIZE: usize = !0usize / 8; +// This test validates we gracefully fail computing a const or static of absurdly large size. +// The oddly-specific number is because of LLVM measuring object sizes in bits. + +const HUGE_SIZE: usize = 1 << 61; pub struct TooBigArray { diff --git a/tests/ui/limits/issue-56762.stderr b/tests/ui/limits/huge-static.stderr similarity index 72% rename from tests/ui/limits/issue-56762.stderr rename to tests/ui/limits/huge-static.stderr index 3a6c3559ac1..19ac65429af 100644 --- a/tests/ui/limits/issue-56762.stderr +++ b/tests/ui/limits/huge-static.stderr @@ -1,14 +1,14 @@ error[E0080]: could not evaluate static initializer - --> $DIR/issue-56762.rs:16:1 + --> $DIR/huge-static.rs:19:1 | LL | static MY_TOO_BIG_ARRAY_1: TooBigArray = TooBigArray::new(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ values of the type `[u8; 2305843009213693951]` are too big for the current architecture + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ values of the type `[u8; 2305843009213693952]` are too big for the current architecture error[E0080]: could not evaluate static initializer - --> $DIR/issue-56762.rs:19:1 + --> $DIR/huge-static.rs:22:1 | LL | static MY_TOO_BIG_ARRAY_2: [u8; HUGE_SIZE] = [0x00; HUGE_SIZE]; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ values of the type `[u8; 2305843009213693951]` are too big for the current architecture + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ values of the type `[u8; 2305843009213693952]` are too big for the current architecture error: aborting due to 2 previous errors