Skip to content

Instantly share code, notes, and snippets.

@jld
Created March 1, 2013 22:39
Show Gist options
  • Select an option

  • Save jld/5068511 to your computer and use it in GitHub Desktop.

Select an option

Save jld/5068511 to your computer and use it in GitHub Desktop.
Rust continues to have a bad day with side effects.
struct S { x: int, y: int }
fn main() {
let w;
let s = S { x: 1, y: 2 };
let _ = S { x: 3, ..({ w = "World"; s }) };
io::println(fmt!("Hello, %s!", w));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment