Skip to content

Commit 9075baf

Browse files
committed
Add array len parse ui tests
1 parent d9f9784 commit 9075baf

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

tests/ui/array_len_expr.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#[cxx::bridge]
2+
mod ffi {
3+
unsafe extern "C++" {
4+
fn arraystr() -> [String; "13"];
5+
fn arraysub() -> [String; 15 - 1];
6+
}
7+
}
8+
9+
fn main() {}

tests/ui/array_len_expr.stderr

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
error: array length must be an integer literal
2+
--> $DIR/array_len_expr.rs:4:35
3+
|
4+
4 | fn arraystr() -> [String; "13"];
5+
| ^^^^
6+
7+
error: unsupported expression, array length must be an integer literal
8+
--> $DIR/array_len_expr.rs:5:35
9+
|
10+
5 | fn arraysub() -> [String; 15 - 1];
11+
| ^^^^^^

0 commit comments

Comments
 (0)