Guest User

Untitled

a guest
Jun 24th, 2018
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. #![allow(unused)]
  2.  
  3. trait Trait {
  4. fn foo(&self);
  5. }
  6.  
  7. struct Impl {}
  8.  
  9. impl Trait for Impl {
  10. fn foo(&self) {
  11. println!("Hi");
  12. }
  13. }
  14.  
  15. fn doo(t: Trait) {
  16. t.foo();
  17. }
  18.  
  19. fn main() {
  20. let i = Impl{};
  21.  
  22. doo(i as Trait);
  23. }
Add Comment
Please, Sign In to add comment