Created
September 8, 2012 22:04
-
-
Save jld/3680156 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 foo<T>(&dst: @const T, &src: @const T) { | |
dst = src; | |
} | |
fn main() | |
{ | |
let mut r_imm = @0; | |
let mut r_mut = @mut 0; | |
foo(r_imm, r_mut); | |
io::println(fmt!("r_imm = %?", r_imm)); | |
*r_mut = 23; | |
io::println(fmt!("r_imm = %?", r_imm)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment