Advertisement
Guest User

Untitled

a guest
Apr 18th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. macro_rules! put_doc_on_S {
  2. ($word:ident) => {
  3. /*
  4. // does not work:
  5.  
  6. #[doc = stringify!($word)]
  7. pub struct S;
  8. */
  9.  
  10. // works:
  11. put_doc_on_S_please!(stringify!($word));
  12. };
  13. }
  14.  
  15. macro_rules! put_doc_on_S_please {
  16. ($word:expr) => {
  17. #[doc = $word]
  18. pub struct S;
  19. };
  20. }
  21.  
  22. put_doc_on_S!(success);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement