SHARE
TWEET

Untitled

a guest May 19th, 2019 74 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #![feature(optin_builtin_traits)]
  2.  
  3. trait Encode {
  4.     fn encode() -> Vec<u8>;
  5. }
  6.  
  7. auto trait GeneralVecEncode {}
  8. impl !GeneralVecEncode for u8 {}
  9.  
  10. impl Encode for u8 {
  11.     fn encode() -> Vec<u8> { vec![0x2; 1] }
  12. }
  13.  
  14. impl<T> Encode for Vec<T>
  15. where
  16.     T: Encode + GeneralVecEncode
  17. {
  18.     fn encode() -> Vec<u8> { vec![0x0; 1] }
  19. }
  20.  
  21. impl Encode for Vec<u8> {
  22.     fn encode() -> Vec<u8> { vec![0x1; 1] }
  23. }
  24.  
  25. fn main() {
  26.    
  27. }
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