Guest User

Untitled

a guest
Aug 19th, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. pub mod test {
  2. pub struct A;
  3. pub struct B;
  4. pub struct Foo<T>(::std::marker::PhantomData<T>);
  5.  
  6. impl Foo<A> {
  7. fn foo(a: usize) -> usize {
  8. a
  9. }
  10. }
  11.  
  12. impl Foo<B> {
  13. fn foo(a: usize, b: usize) -> usize {
  14. b
  15. }
  16. }
  17. }
  18.  
  19. fn main() {
  20. test::Foo::<test::B>::foo(0, 0);
  21. }
Add Comment
Please, Sign In to add comment