daily pastebin goal
32%
SHARE
TWEET

Untitled

a guest Jun 24th, 2018 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
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