We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4c77f86 commit cb82cdcCopy full SHA for cb82cdc
tests/pass/arrays.rs
@@ -61,6 +61,20 @@ fn debug() {
61
println!("{:?}", array);
62
}
63
64
+fn huge_zst() {
65
+ fn id<T>(x: T) -> T { x }
66
+
67
+ // A "huge" zero-sized array. Make sure we don't loop over it in any part of Miri.
68
+ let val = [(); usize::MAX];
69
+ id(val); // make a copy
70
71
+ let val = [val; 2];
72
+ id(val);
73
74
+ // Also wrap it in a union (which, in particular, hits the logic for computing union padding).
75
+ let _copy = std::mem::MaybeUninit::new(val);
76
+}
77
78
fn main() {
79
assert_eq!(empty_array(), []);
80
assert_eq!(index_unsafe(), 20);
@@ -73,4 +87,5 @@ fn main() {
87
from();
88
eq();
89
debug();
90
+ huge_zst();
91
0 commit comments