Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. #![feature(existential_type)]
  2.  
  3. use std::fmt::Display;
  4.  
  5. fn main() {
  6. println!("Hello, world!");
  7. }
  8.  
  9. trait Test {
  10. type Out: Display;
  11.  
  12. fn test(&self) -> Self::Out;
  13. }
  14.  
  15. impl Test for () {
  16. existential type Out: Display;
  17.  
  18. fn test(&self) -> Self::Out {
  19. "abcd"
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement