Advertisement
Guest User

Untitled

a guest
Jul 16th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. struct NoDerive;
  2.  
  3. impl PartialEq for NoDerive {
  4. fn eq(&self, _: &Self) -> bool { false }
  5. }
  6.  
  7. impl Eq for NoDerive { }
  8.  
  9. #[derive(PartialEq, Eq)]
  10. struct WrapInline(NoDerive);
  11.  
  12. const WRAP_INLINE: & &WrapInline = & &WrapInline(NoDerive);
  13.  
  14. fn main() {
  15. match WRAP_INLINE {
  16. WRAP_INLINE => { println!("WRAP_INLINE matched WRAP_INLINE"); }
  17. _ => { println!("WRAP_INLINE did not match WRAP_INLINE"); }
  18. }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement