about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2023-08-07 08:18:50 +0200
committerRalf Jung <post@ralfj.de>2023-08-30 13:46:55 +0200
commit6d1ce9bd131d16166000f232cca00bc446bc9e35 (patch)
tree51e5a68491ceb506daffe00f9263437a1793fef0 /src
parentf87e91de7db20e1c3804f7d90c487bd83ef80d76 (diff)
downloadrust-6d1ce9bd131d16166000f232cca00bc446bc9e35.tar.gz
rust-6d1ce9bd131d16166000f232cca00bc446bc9e35.zip
storage_live: avoid computing the layout unless necessary
Diffstat (limited to 'src')
-rw-r--r--src/tools/miri/tests/fail/type-too-large.rs4
-rw-r--r--src/tools/miri/tests/fail/type-too-large.stderr4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/tools/miri/tests/fail/type-too-large.rs b/src/tools/miri/tests/fail/type-too-large.rs
index 2e23b79d5f8..81ecc6145d7 100644
--- a/src/tools/miri/tests/fail/type-too-large.rs
+++ b/src/tools/miri/tests/fail/type-too-large.rs
@@ -1,6 +1,6 @@
 //@ignore-32bit
 
 fn main() {
-    let _fat: [u8; (1 << 61) + (1 << 31)]; //~ ERROR: post-monomorphization error
-    _fat = [0; (1u64 << 61) as usize + (1u64 << 31) as usize];
+    let _fat: [u8; (1 << 61) + (1 << 31)]; // ideally we'd error here, but we avoid computing the layout until absolutely necessary
+    _fat = [0; (1u64 << 61) as usize + (1u64 << 31) as usize]; //~ ERROR: post-monomorphization error
 }
diff --git a/src/tools/miri/tests/fail/type-too-large.stderr b/src/tools/miri/tests/fail/type-too-large.stderr
index 70891fcc22b..cb1d725ec87 100644
--- a/src/tools/miri/tests/fail/type-too-large.stderr
+++ b/src/tools/miri/tests/fail/type-too-large.stderr
@@ -1,8 +1,8 @@
 error: post-monomorphization error: values of the type `[u8; 2305843011361177600]` are too big for the current architecture
   --> $DIR/type-too-large.rs:LL:CC
    |
-LL |     let _fat: [u8; (1 << 61) + (1 << 31)];
-   |         ^^^^ values of the type `[u8; 2305843011361177600]` are too big for the current architecture
+LL |     _fat = [0; (1u64 << 61) as usize + (1u64 << 31) as usize];
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ values of the type `[u8; 2305843011361177600]` are too big for the current architecture
    |
    = note: inside `main` at $DIR/type-too-large.rs:LL:CC