]> git.lizzy.rs Git - rust.git/blob - src/test/ui/macros/doc-comment.rs
Rollup merge of #87596 - jesyspa:issue-87318-hidden-whitespace, r=estebank
[rust.git] / src / test / ui / macros / doc-comment.rs
1 // check-pass
2 // Tests that we properly handle a nested macro expansion
3 // involving a `#[doc]` attribute
4 #![deny(missing_docs)]
5 //! Crate docs
6
7 macro_rules! doc_comment {
8     ($x:expr, $($tt:tt)*) => {
9         #[doc = $x]
10         $($tt)*
11     }
12 }
13
14 macro_rules! make_comment {
15     () => {
16         doc_comment!("Function docs",
17             pub fn bar() {}
18         );
19     }
20 }
21
22
23 make_comment!();
24
25 fn main() {}