由于分号在Rust中显然是可选的,为什么,如果我这样做:
fn fn1() -> i32 {
let a = 1
let b = 2
3
}
Run Code Online (Sandbox Code Playgroud)
我收到错误:
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
Run Code Online (Sandbox Code Playgroud)
?