Skip to content

Instantly share code, notes, and snippets.

Created September 13, 2016 20:36
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