Add array len parse ui tests

This commit is contained in:
David Tolnay 2020-11-24 21:12:48 -08:00
parent d9f9784c93
commit 9075bafa1d
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82
2 changed files with 20 additions and 0 deletions

View File

@ -0,0 +1,9 @@
#[cxx::bridge]
mod ffi {
unsafe extern "C++" {
fn arraystr() -> [String; "13"];
fn arraysub() -> [String; 15 - 1];
}
}
fn main() {}

View 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];
| ^^^^^^