mirror of
https://gitee.com/openharmony/third_party_rust_cxx
synced 2024-11-23 23:29:50 +00:00
Add array len parse ui tests
This commit is contained in:
parent
d9f9784c93
commit
9075bafa1d
9
tests/ui/array_len_expr.rs
Normal file
9
tests/ui/array_len_expr.rs
Normal file
@ -0,0 +1,9 @@
|
||||
#[cxx::bridge]
|
||||
mod ffi {
|
||||
unsafe extern "C++" {
|
||||
fn arraystr() -> [String; "13"];
|
||||
fn arraysub() -> [String; 15 - 1];
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {}
|
11
tests/ui/array_len_expr.stderr
Normal file
11
tests/ui/array_len_expr.stderr
Normal file
@ -0,0 +1,11 @@
|
||||
error: array length must be an integer literal
|
||||
--> $DIR/array_len_expr.rs:4:35
|
||||
|
|
||||
4 | fn arraystr() -> [String; "13"];
|
||||
| ^^^^
|
||||
|
||||
error: unsupported expression, array length must be an integer literal
|
||||
--> $DIR/array_len_expr.rs:5:35
|
||||
|
|
||||
5 | fn arraysub() -> [String; 15 - 1];
|
||||
| ^^^^^^
|
Loading…
Reference in New Issue
Block a user