Skip to content

Instantly share code, notes, and snippets.

@kindlychung
Forked from anonymous/playground.rs
Last active September 13, 2016 20:40
Show Gist options
  • Save kindlychung/0641fd3a380768fe47a515a0f9541815 to your computer and use it in GitHub Desktop.
Save kindlychung/0641fd3a380768fe47a515a0f9541815 to your computer and use it in GitHub Desktop.
Shared via Rust Playground
#[derive(Debug)]
struct Foo<'a> {
x: &'a i32,
}
fn main() {
let y = &5;
{
let foo;
foo = Foo { x: y };
println!("{:?}", foo);
}
}
#[derive(Debug)]
struct Foo<'a> {
x: &'a i32,
}
fn main() {
let foo;
{
let y = &5;
foo = Foo { x: y };
}
println!("{:?}", foo);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment