最佳答案
既然分号在 Rust 中是可选的,为什么,如果我这样做:
fn fn1() -> i32 {
let a = 1
let b = 2
3
}
我得到了一个错误:
error: expected one of `.`, `;`, `?`, or an operator, found `let`
--> src/main.rs:3:9
|
2 | let a = 1
| - expected one of `.`, `;`, `?`, or an operator here
3 | let b = 2
| ^^^ unexpected token