Update tests for const-eval error handling changes.

This commit is contained in:
Felix S. Klock II 2015-02-22 16:38:22 +01:00
parent 46de12ad00
commit 8491c82c90
4 changed files with 9 additions and 3 deletions

View File

@ -23,6 +23,7 @@ pub trait Public: Private<
<Self as Public>::P,
//~^ ERROR illegal recursive type; insert an enum or struct in the cycle, if this is desired
<Self as Public>::R
//~^ ERROR unsupported cyclic reference between types/traits detected
> {
type P;
type R;

View File

@ -12,5 +12,7 @@ const TUP: (usize,) = (42,);
fn main() {
let a: [isize; TUP.1];
//~^ ERROR expected constant expr for array length: tuple index out of bounds
//~^ ERROR array length constant evaluation error: tuple index out of bounds
//~| ERROR attempted out-of-bounds tuple index
//~| ERROR attempted out-of-bounds tuple index
}

View File

@ -13,5 +13,7 @@ const STRUCT: MyStruct = MyStruct { field: 42 };
fn main() {
let a: [isize; STRUCT.nonexistent_field];
//~^ ERROR expected constant expr for array length: nonexistent struct field
//~^ ERROR array length constant evaluation error: nonexistent struct field
//~| ERROR attempted access of field `nonexistent_field`
//~| ERROR attempted access of field `nonexistent_field`
}

View File

@ -13,6 +13,7 @@
fn main() {
fn bar(n: isize) {
let _x: [isize; n];
//~^ ERROR expected constant expr for array length: non-constant path in constant expr
//~^ ERROR no type for local variable
//~| ERROR array length constant evaluation error: non-constant path in constant expr
}
}