File tree 2 files changed +22
-1
lines changed
2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -324,6 +324,7 @@ impl<'a> Visitor<'a> for CollectProcMacros<'a> {
324
324
325
325
// Creates a new module which looks like:
326
326
//
327
+ // #[doc(hidden)]
327
328
// mod $gensym {
328
329
// extern crate proc_macro;
329
330
//
@@ -357,6 +358,10 @@ fn mk_decls(
357
358
} ) ;
358
359
let span = DUMMY_SP . apply_mark ( mark) ;
359
360
361
+ let hidden = cx. meta_list_item_word ( span, Symbol :: intern ( "hidden" ) ) ;
362
+ let doc = cx. meta_list ( span, Symbol :: intern ( "doc" ) , vec ! [ hidden] ) ;
363
+ let doc_hidden = cx. attribute ( span, doc) ;
364
+
360
365
let proc_macro = Ident :: from_str ( "proc_macro" ) ;
361
366
let krate = cx. item ( span,
362
367
proc_macro,
@@ -421,7 +426,7 @@ fn mk_decls(
421
426
span,
422
427
span,
423
428
ast:: Ident :: with_empty_ctxt ( Symbol :: gensym ( "decls" ) ) ,
424
- vec ! [ ] ,
429
+ vec ! [ doc_hidden ] ,
425
430
vec ! [ krate, decls_static] ,
426
431
) . map ( |mut i| {
427
432
i. vis = respan ( span, ast:: VisibilityKind :: Public ) ;
Original file line number Diff line number Diff line change
1
+ //! Verify that the `decls` module implicitly added by the compiler does not cause `missing_docs`
2
+ //! warnings.
3
+
4
+ // compile-pass
5
+ // force-host
6
+ // no-prefer-dynamic
7
+
8
+ #![ crate_type = "proc-macro" ]
9
+ #![ deny( missing_docs) ]
10
+
11
+ extern crate proc_macro;
12
+ use proc_macro:: * ;
13
+
14
+ /// Foo1.
15
+ #[ proc_macro]
16
+ pub fn foo1 ( input : TokenStream ) -> TokenStream { input }
You can’t perform that action at this time.
0 commit comments