SHARE
TWEET

Untitled

a guest Aug 18th, 2019 45 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #![warn(single_use_lifetimes)]
  2.  
  3. pub struct Foo<'x> {
  4.     pub x: &'x i32,
  5. }
  6.  
  7. fn print<'a>(x: &'a i32) {
  8.     println!("{}", x);
  9. }
  10.  
  11. fn main() {
  12.     let x = 42;
  13.     let foo = Foo { x: &x };
  14.     print(&foo.x);
  15. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top