Advertisement
Guest User

Untitled

a guest
Apr 19th, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. #[derive(Debug)]
  2. struct Foo<'a>(&'a i32);
  3.  
  4. impl<'a> Foo<'a> {
  5. fn foo(self) {
  6. std::thread::spawn(move || println!("{:?}", self)).join().unwrap();
  7. }
  8. }
  9.  
  10. impl Foo<'static> {
  11. fn bar(self) {
  12. std::thread::spawn(move || println!("{:?}", self)).join().unwrap();
  13. }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement