Skip to content

Commit a05148f

Browse files
committed
Update tests for const-eval error handling changes.
1 parent f0d9fd5 commit a05148f

File tree

4 files changed

+10
-3
lines changed

4 files changed

+10
-3
lines changed

src/test/compile-fail/issue-18389.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ trait Private<P: Pt, R: Rt> {
2222
pub trait Public: Private<
2323
<Self as Public>::P,
2424
//~^ ERROR illegal recursive type; insert an enum or struct in the cycle, if this is desired
25+
//~| ERROR illegal recursive type; insert an enum or struct in the cycle, if this is desired
2526
<Self as Public>::R
27+
//~^ ERROR illegal recursive type; insert an enum or struct in the cycle, if this is desired
2628
> {
2729
type P;
2830
type R;

src/test/compile-fail/issue-19244-1.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,7 @@ const TUP: (usize,) = (42,);
1212

1313
fn main() {
1414
let a: [isize; TUP.1];
15-
//~^ ERROR expected constant expr for array length: tuple index out of bounds
15+
//~^ ERROR array length constant evaluation error: tuple index out of bounds
16+
//~| ERROR attempted out-of-bounds tuple index
17+
//~| ERROR attempted out-of-bounds tuple index
1618
}

src/test/compile-fail/issue-19244-2.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,7 @@ const STRUCT: MyStruct = MyStruct { field: 42 };
1313

1414
fn main() {
1515
let a: [isize; STRUCT.nonexistent_field];
16-
//~^ ERROR expected constant expr for array length: nonexistent struct field
16+
//~^ ERROR array length constant evaluation error: nonexistent struct field
17+
//~| ERROR attempted access of field `nonexistent_field`
18+
//~| ERROR attempted access of field `nonexistent_field`
1719
}

src/test/compile-fail/non-constant-expr-for-fixed-len-vec.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
fn main() {
1414
fn bar(n: isize) {
1515
let _x: [isize; n];
16-
//~^ ERROR expected constant expr for array length: non-constant path in constant expr
16+
//~^ ERROR no type for local variable
17+
//~| ERROR array length constant evaluation error: non-constant path in constant expr
1718
}
1819
}

0 commit comments

Comments
 (0)