Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #![warn(single_use_lifetimes)]
- pub struct Foo<'x> {
- pub x: &'x i32,
- }
- fn print<'a>(x: &'a i32) {
- println!("{}", x);
- }
- fn main() {
- let x = 42;
- let foo = Foo { x: &x };
- print(&foo.x);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement