SHARE
TWEET

Untitled

a guest Apr 18th, 2019 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. struct Board;
  2.  
  3. struct Foo<'a>(&'a Board);
  4. struct Bar;
  5.  
  6. trait Thing<'a> {}
  7.  
  8. impl<'a> Thing<'a> for Foo<'a> {}
  9. impl<'a> Thing<'a> for Bar {}
  10.  
  11. fn do_thing<'a>(board: &'a Board, a: Box<dyn Thing<'a>>, b: Box<dyn Thing<'a>>) {
  12.    
  13. }
  14.  
  15. fn test() {
  16.     let board = Board;
  17.     let foo = Foo(&board);
  18.     let bar = Bar;
  19.     do_thing(&board, Box::new(foo), Box::new(bar));
  20. }
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