Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 3ce5a95

Browse files
committedOct 17, 2014
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.
1 parent 50db061 commit 3ce5a95

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed
 

‎src/test/compile-fail/huge-array-simple.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@
1111
// error-pattern: too big for the current
1212

1313
fn main() {
14-
let fat : [u8, ..1<<61] = [0, ..1<<61];
14+
let fat : [u8, ..(1<<61)+(1<<31)] = [0, ..(1<<61)+(1<<31)];
1515
}

‎src/test/compile-fail/issue-17913.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,16 @@
1010

1111
// error-pattern: too big for the current architecture
1212

13+
#[cfg(target_word_size = "64")]
1314
fn main() {
1415
let n = 0u;
1516
let a = box [&n,..0xF000000000000000u];
1617
println!("{}", a[0xFFFFFFu]);
1718
}
19+
20+
#[cfg(target_word_size = "32")]
21+
fn main() {
22+
let n = 0u;
23+
let a = box [&n,..0xFFFFFFFFu];
24+
println!("{}", a[0xFFFFFFu]);
25+
}

4 commit comments

Comments
 (4)

bors commented on Oct 18, 2014

@bors
Collaborator

saw approval from pnkfelix
at arielb1@3ce5a95

bors commented on Oct 18, 2014

@bors
Collaborator

merging arielb1/rust/no-size-overflow = 3ce5a95 into auto

bors commented on Oct 18, 2014

@bors
Collaborator

arielb1/rust/no-size-overflow = 3ce5a95 merged ok, testing candidate = 9c11773e

Please sign in to comment.