Add ui test of struct cycle

This commit is contained in:
David Tolnay 2020-11-03 18:36:10 -08:00
parent acae7a6aae
commit 07b7c13bc8
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82
2 changed files with 35 additions and 0 deletions

30
tests/ui/struct_cycle.rs Normal file
View File

@ -0,0 +1,30 @@
#[cxx::bridge]
mod ffi {
struct Node0 {
i: i32,
}
struct Node1 {
node2: Node2,
vec: Vec<Node3>,
}
struct Node2 {
node4: Node4,
}
struct Node3 {
node1: Node1,
}
struct Node4 {
node0: Node0,
node5: Node5,
}
struct Node5 {
node2: Node2,
}
}
fn main() {}

View File

@ -0,0 +1,5 @@
error: unsupported cyclic data structure
--> $DIR/struct_cycle.rs:26:9
|
26 | node2: Node2,
| ^^^^^^^^^^^^