Guest User

Untitled

a guest
Mar 23rd, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. #![feature(specialization)]
  2.  
  3. trait Foo
  4. {
  5. type Bar;
  6.  
  7. fn test(arg: Self::Bar) where
  8. Self: Sized;
  9. }
  10.  
  11. struct Baz<T>
  12. {
  13. qux: T
  14. }
  15.  
  16. impl<T> Foo for Baz<T>
  17. {
  18. default type Bar = T;
  19.  
  20. default fn test(arg: Self::Bar) where
  21. Self: Sized
  22. {
  23. Self
  24. {
  25. qux: arg
  26. };
  27.  
  28. println!("test!");
  29. }
  30. }
  31.  
  32. fn main()
  33. {
  34.  
  35. }
Add Comment
Please, Sign In to add comment