Last active
July 17, 2016 19:00
-
-
Save H2CO3/85f819bb0a734efa6a3d120438cb8d59 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 take_mut_ref(ptr: &mut i32) { | |
*ptr += 1; | |
} | |
fn main() { | |
let mut x = 42; | |
{ | |
let ptr = &mut x; | |
take_mut_ref(ptr); | |
println!("{:p}", ptr); | |
} | |
println!("{}", x); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment