Skip to content

Instantly share code, notes, and snippets.

Created September 13, 2016 20:36
Show Gist options
  • Save anonymous/f2a04a33dec921b0d6ea7b5d4a8f7c95 to your computer and use it in GitHub Desktop.
Save anonymous/f2a04a33dec921b0d6ea7b5d4a8f7c95 to your computer and use it in GitHub Desktop.
Shared via Rust Playground
#[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