当我尝试在另一个结构体内声明一个结构体时:
struct Test {
struct Foo {}
}
编译器报错:error: expected identifier, found keyword `struct`
--> src/lib.rs:2:5
|
2 | struct Foo {}
| ^^^^^^ expected identifier, found keyword
help: you can escape reserved keywords to use them as identifiers
|
2 | r#struct Foo {}
| ^^^^^^^^
error: expected `:`, found `Foo`
--> src/lib.rs:2:12
|
2 | struct Foo {}
| ^^^ expected `:`
我找不到任何相关的文档,嵌套结构体在Rust中是否受支持?