Skip to content

Commit 8491c82

Browse files
committed
Update tests for const-eval error handling changes.
1 parent 46de12a commit 8491c82

File tree

4 files changed

+9
-3
lines changed

4 files changed

+9
-3
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ 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
2525
<Self as Public>::R
26+
//~^ ERROR unsupported cyclic reference between types/traits detected
2627
> {
2728
type P;
2829
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)