Guest User

Untitled

a guest
Dec 13th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.17 KB | None | 0 0
  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() {}
Add Comment
Please, Sign In to add comment