Guest User

Untitled

a guest
May 21st, 2018
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. trait Foo {
  2. fn foo();
  3. }
  4.  
  5. impl Foo for Vec<u8> {
  6. fn foo() { println!("u8"); }
  7. }
  8.  
  9. impl Foo for Vec<usize> {
  10. fn foo() { println!("usize"); }
  11. }
  12.  
  13. fn main() {
  14. // Error: Rust doesn't konw the type.
  15. // Vec::foo();
  16. Vec::<u8>::foo();
  17. Vec::<usize>::foo();
  18. }
Add Comment
Please, Sign In to add comment