Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
estebank committed Aug 6, 2019
1 parent f621f89 commit ce8510a
Show file tree
Hide file tree
Showing 14 changed files with 78 additions and 55 deletions.
5 changes: 4 additions & 1 deletion src/test/ui/consts/issue-55878.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
// error-pattern: the type `[u8; 18446744073709551615]` is too big for the current architecture
// normalize-stderr-64bit "18446744073709551615" -> "SIZE"
// normalize-stderr-32bit "4294967295" -> "SIZE"

// error-pattern: is too big for the current architecture
fn main() {
println!("Size: {}", std::mem::size_of::<[u8; std::u64::MAX as usize]>());
}
4 changes: 2 additions & 2 deletions src/test/ui/consts/issue-55878.stderr
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
error[E0080]: the type `[u8; 18446744073709551615]` is too big for the current architecture
error[E0080]: the type `[u8; SIZE]` is too big for the current architecture
--> $SRC_DIR/libcore/mem/mod.rs:LL:COL
|
LL | intrinsics::size_of::<T>()
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
::: $DIR/issue-55878.rs:3:26
::: $DIR/issue-55878.rs:6:26
|
LL | println!("Size: {}", std::mem::size_of::<[u8; std::u64::MAX as usize]>());
| ---------------------------------------------------
Expand Down
11 changes: 11 additions & 0 deletions src/test/ui/huge-array-simple-32.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// ignore-32bit

// FIXME https://github.com/rust-lang/rust/issues/59774
// normalize-stderr-test "thread.*panicked.*Metadata module not compiled.*\n" -> ""
// normalize-stderr-test "note:.*RUST_BACKTRACE=1.*\n" -> ""
#![allow(exceeding_bitshifts)]

fn main() {
let _fat: [u8; (1<<61)+(1<<31)] = //~ ERROR too big for the current architecture
[0; (1u64<<61) as usize +(1u64<<31) as usize];
}
8 changes: 8 additions & 0 deletions src/test/ui/huge-array-simple-32.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
error: the type `[u8; 2305843011361177600]` is too big for the current architecture
--> $DIR/huge-array-simple-32.rs:9:9
|
LL | let _fat: [u8; (1<<61)+(1<<31)] =
| ^^^^

error: aborting due to previous error

11 changes: 11 additions & 0 deletions src/test/ui/huge-array-simple-64.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// ignore-64bit

// FIXME https://github.com/rust-lang/rust/issues/59774
// normalize-stderr-test "thread.*panicked.*Metadata module not compiled.*\n" -> ""
// normalize-stderr-test "note:.*RUST_BACKTRACE=1.*\n" -> ""
#![allow(exceeding_bitshifts)]

fn main() {
let _fat: [u8; (1<<31)+(1<<15)] = //~ ERROR too big for the current architecture
[0; (1u32<<31) as usize +(1u32<<15) as usize];
}
8 changes: 8 additions & 0 deletions src/test/ui/huge-array-simple-64.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
error: the type `[u8; 2147516416]` is too big for the current architecture
--> $DIR/huge-array-simple-64.rs:9:9
|
LL | let _fat: [u8; (1<<31)+(1<<15)] =
| ^^^^

error: aborting due to previous error

20 changes: 0 additions & 20 deletions src/test/ui/huge-array-simple.rs

This file was deleted.

8 changes: 0 additions & 8 deletions src/test/ui/huge-array-simple.stderr

This file was deleted.

9 changes: 9 additions & 0 deletions src/test/ui/issues/issue-15919-32.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// ignore-64bit

// FIXME https://github.com/rust-lang/rust/issues/59774
// normalize-stderr-test "thread.*panicked.*Metadata module not compiled.*\n" -> ""
// normalize-stderr-test "note:.*RUST_BACKTRACE=1.*\n" -> ""

fn main() {
let x = [0usize; 0xffff_ffff]; //~ ERROR too big
}
8 changes: 8 additions & 0 deletions src/test/ui/issues/issue-15919-32.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
error: the type `[usize; 4294967295]` is too big for the current architecture
--> $DIR/issue-15919-32.rs:8:9
|
LL | let x = [0usize; 0xffff_ffff];
| ^

error: aborting due to previous error

9 changes: 9 additions & 0 deletions src/test/ui/issues/issue-15919-64.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// ignore-32bit

// FIXME https://github.com/rust-lang/rust/issues/59774
// normalize-stderr-test "thread.*panicked.*Metadata module not compiled.*\n" -> ""
// normalize-stderr-test "note:.*RUST_BACKTRACE=1.*\n" -> ""

fn main() {
let x = [0usize; 0xffff_ffff_ffff_ffff]; //~ ERROR too big
}
8 changes: 8 additions & 0 deletions src/test/ui/issues/issue-15919-64.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
error: the type `[usize; 18446744073709551615]` is too big for the current architecture
--> $DIR/issue-15919-64.rs:8:9
|
LL | let x = [0usize; 0xffff_ffff_ffff_ffff];
| ^

error: aborting due to previous error

16 changes: 0 additions & 16 deletions src/test/ui/issues/issue-15919.rs

This file was deleted.

8 changes: 0 additions & 8 deletions src/test/ui/issues/issue-15919.stderr

This file was deleted.

0 comments on commit ce8510a

Please sign in to comment.