Test include parsing

This commit is contained in:
David Tolnay 2020-05-11 19:32:44 -07:00
parent 91e87fa51e
commit cf96664b29
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82
2 changed files with 41 additions and 0 deletions

12
tests/ui/include.rs Normal file
View File

@ -0,0 +1,12 @@
#[cxx::bridge]
mod ffi {
extern "C" {
include!("path/to" what);
include!(<path/to> what);
include!(<path/to);
include!(<path[to]>);
include!(...);
}
}
fn main() {}

29
tests/ui/include.stderr Normal file
View File

@ -0,0 +1,29 @@
error: unexpected token
--> $DIR/include.rs:4:28
|
4 | include!("path/to" what);
| ^^^^
error: unexpected token
--> $DIR/include.rs:5:28
|
5 | include!(<path/to> what);
| ^^^^
error: expected `>`
--> $DIR/include.rs:6:17
|
6 | include!(<path/to);
| ^^^^^^^^^^
error: unexpected token in include path
--> $DIR/include.rs:7:23
|
7 | include!(<path[to]>);
| ^^^^
error: expected "quoted/path/to" or <bracketed/path/to>
--> $DIR/include.rs:8:18
|
8 | include!(...);
| ^^^