mirror of
https://github.com/topjohnwu/cxx.git
synced 2025-02-24 10:03:39 +00:00
Add ui test for reserved type names
This commit is contained in:
parent
0b368ae341
commit
2dd73eaf03
16
tests/ui/reserved_name.rs
Normal file
16
tests/ui/reserved_name.rs
Normal file
@ -0,0 +1,16 @@
|
||||
#[cxx::bridge]
|
||||
mod ffi {
|
||||
struct UniquePtr {
|
||||
val: usize,
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
type Box;
|
||||
}
|
||||
|
||||
extern "Rust" {
|
||||
type String;
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {}
|
17
tests/ui/reserved_name.stderr
Normal file
17
tests/ui/reserved_name.stderr
Normal file
@ -0,0 +1,17 @@
|
||||
error: reserved name
|
||||
--> $DIR/reserved_name.rs:3:12
|
||||
|
|
||||
3 | struct UniquePtr {
|
||||
| ^^^^^^^^^
|
||||
|
||||
error: reserved name
|
||||
--> $DIR/reserved_name.rs:8:14
|
||||
|
|
||||
8 | type Box;
|
||||
| ^^^
|
||||
|
||||
error: reserved name
|
||||
--> $DIR/reserved_name.rs:12:14
|
||||
|
|
||||
12 | type String;
|
||||
| ^^^^^^
|
Loading…
x
Reference in New Issue
Block a user