mirror of
https://github.com/KaiserY/trpl-zh-cn
synced 2025-02-24 21:32:15 +08:00
9 lines
304 B
Rust
9 lines
304 B
Rust
|
fn main() {
|
|||
|
// ANCHOR: here
|
|||
|
{ // s is not valid here, it’s not yet declared
|
|||
|
let s = "hello"; // s is valid from this point forward
|
|||
|
|
|||
|
// do stuff with s
|
|||
|
} // this scope is now over, and s is no longer valid
|
|||
|
// ANCHOR_END: here
|
|||
|
}
|