Make the tests green as they should on 32-bit architectures

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.
This commit is contained in:
Ariel Ben-Yehuda 2014-10-17 12:37:27 +03:00
parent 50db061173
commit 3ce5a9539f
2 changed files with 9 additions and 1 deletions

View file

@ -11,5 +11,5 @@
// 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)];
}

View file

@ -10,8 +10,16 @@
// 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]);
}