Created
February 20, 2018 00:49
-
-
Save cbzehner/94a06656a929d57dfac0c7ce4837b7c1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn main() { | |
let r = 2; | |
{ | |
let x = 5; | |
let r = x; | |
} | |
println!("r: {}", r); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The second
r
declaration gets dropped when we go out of scope of the inner{ }