Skip to content

Commit

Permalink
dealing with fallout to the tests, in particular diffs between 32- vs…
Browse files Browse the repository at this point in the history
… 64-bit targets.

See also rust-lang#23926.
  • Loading branch information
pnkfelix committed Apr 1, 2015
1 parent 2243a2c commit 2a9de1d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
8 changes: 6 additions & 2 deletions src/test/compile-fail/const-eval-overflow-3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@
//
// This test is checking the count in an array expression.

// FIXME (#23926): the error output is not consistent between a
// self-hosted and a cross-compiled setup; therefore resorting to
// error-pattern for now.

// error-pattern: expected constant integer for repeat count, but attempted to add with overflow

#![allow(unused_imports)]

use std::fmt;
Expand All @@ -22,8 +28,6 @@ use std::{u8, u16, u32, u64, usize};
const A_I8_I
: [u32; (i8::MAX as usize) + 1]
= [0; (i8::MAX + 1) as usize];
//~^ ERROR mismatched types
//~| ERROR expected constant integer for repeat count, but attempted to add with overflow

fn main() {
foo(&A_I8_I[..]);
Expand Down
11 changes: 6 additions & 5 deletions src/test/compile-fail/const-eval-overflow-3b.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@
// types for the left- and right-hand sides of the addition do not
// match (as well as overflow).

// FIXME (#23926): the error output is not consistent between a
// self-hosted and a cross-compiled setup; therefore resorting to
// error-pattern for now.

// error-pattern: mismatched types

#![allow(unused_imports)]

use std::fmt;
Expand All @@ -26,11 +32,6 @@ use std::{u8, u16, u32, u64, usize};
const A_I8_I
: [u32; (i8::MAX as usize) + 1]
= [0; (i8::MAX + 1u8) as usize];
//~^ ERROR mismatched types
//~| ERROR mismatched types
//~| ERROR expected constant integer for repeat count, but attempted to add with overflow
//~| ERROR the trait `core::ops::Add<u8>` is not implemented for the type `i8`
//~| ERROR the trait `core::ops::Add<u8>` is not implemented for the type `i8`

fn main() {
foo(&A_I8_I[..]);
Expand Down
9 changes: 6 additions & 3 deletions src/test/compile-fail/huge-array-simple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

// FIXME (#23926): the error output is not consistent between a
// self-hosted and a cross-compiled setup. Skipping for now.

// ignore-test FIXME(#23926)

#![allow(exceeding_bitshifts)]

fn main() {
let fat : [u8; (1<<61)+(1<<31)] =
//~^ ERROR array length constant evaluation error: attempted left shift with overflow
let _fat : [u8; (1<<61)+(1<<31)] =
[0; (1u64<<61) as usize +(1u64<<31) as usize];
//~^ ERROR expected constant integer for repeat count, but attempted left shift with overflow
}

0 comments on commit 2a9de1d

Please sign in to comment.