On 32-bit architectures, the size calculations on two of the tests wrap-around
in typeck, which gives the relevant arrays a size of 0, which is (correctly)
successfully allocated.
// error-pattern: too big for the current
fn main() {
- let fat : [u8, ..1<<61] = [0, ..1<<61];
+ let fat : [u8, ..(1<<61)+(1<<31)] = [0, ..(1<<61)+(1<<31)];
}
// error-pattern: too big for the current architecture
+#[cfg(target_word_size = "64")]
fn main() {
let n = 0u;
let a = box [&n,..0xF000000000000000u];
println!("{}", a[0xFFFFFFu]);
}
+
+#[cfg(target_word_size = "32")]
+fn main() {
+ let n = 0u;
+ let a = box [&n,..0xFFFFFFFFu];
+ println!("{}", a[0xFFFFFFu]);
+}