Skip to content

Instantly share code, notes, and snippets.

@jld
Created September 8, 2012 22:04
Show Gist options
  • Save jld/3680156 to your computer and use it in GitHub Desktop.
Save jld/3680156 to your computer and use it in GitHub Desktop.
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