Hi , dear all,
I'm totally new for Rust and I'm reading the rustc source to learn how a rust source is represented by AST. Take the following example
fn main() {
if 1==1 {};
}
my questtion is how the if is represented in AST? I can't find out a StmtKind for it. It seems it is not one of the StmtKind nor one of the ItemKind. Many thanks!!!
It's not a statement nor an item, it's an expression. Rust is an expression language: almost any construct that actively does something at runtime can have a value, and so is an expression, not a statement.