SHARE
TWEET

Untitled

a guest Dec 13th, 2018 48 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. trait A {
  2.     fn foo<T>(&self, t: T) -> T;
  3. }
  4.  
  5. struct B {}
  6.  
  7. impl A for B {
  8.     fn foo<T>(&self, t: T) -> T { t }
  9. }
  10.  
  11. fn bar(a: Box<A>) -> i32 {
  12.     a.foo::<i32>(0)
  13. }
  14.  
  15. fn main() {}
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
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top