Skip to content

Commit

Permalink
Update tests for const-eval error handling changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
pnkfelix committed Feb 24, 2015
1 parent f0d9fd5 commit a05148f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/test/compile-fail/issue-18389.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ trait Private<P: Pt, R: Rt> {
pub trait Public: Private<
<Self as Public>::P,
//~^ ERROR illegal recursive type; insert an enum or struct in the cycle, if this is desired
//~| ERROR illegal recursive type; insert an enum or struct in the cycle, if this is desired
<Self as Public>::R
//~^ ERROR illegal recursive type; insert an enum or struct in the cycle, if this is desired
> {
type P;
type R;
Expand Down
4 changes: 3 additions & 1 deletion src/test/compile-fail/issue-19244-1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
4 changes: 3 additions & 1 deletion src/test/compile-fail/issue-19244-2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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`
}
3 changes: 2 additions & 1 deletion src/test/compile-fail/non-constant-expr-for-fixed-len-vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

0 comments on commit a05148f

Please sign in to comment.