SHARE
TWEET

Untitled

a guest Oct 23rd, 2019 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. mod private {
  2.     #[derive(Debug)]
  3.     pub enum Mark {
  4.         Neat,
  5.         Cool { a: u32 },
  6.     }
  7. }
  8. pub use private::Mark::*;
  9.  
  10. enum _Private {
  11.     Fail,
  12.     Aw,
  13. }
  14.  
  15. // error: enum is private and its variants cannot be re-exported
  16. // pub use _Private::*;
  17.  
  18. pub fn test(thing: private::Mark) {
  19.     dbg!(thing);
  20. }
  21.  
  22. fn main() {
  23.     test(Neat);
  24.     test(Cool { a: 3 });
  25.     // test(Mark::Neat);
  26. }
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