SHARE
TWEET

Untitled

a guest May 23rd, 2019 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #[derive(Debug)]
  2. struct Foo {}
  3.  
  4. #[derive(Debug)]
  5. struct Bar<'a>(&'a Foo);
  6.  
  7. impl<'a> Bar<'a> {
  8.     pub fn new(x: &'a Foo) -> Self { Bar(x) }
  9.     pub fn new2() -> Self { Bar(&Foo{}) }
  10. }
  11.  
  12.  
  13. fn main() {
  14.     let x = Bar::new2();
  15.     println!("x = {:?}", &x);
  16. }
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