File tree Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Expand file tree Collapse file tree 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> {
324324
325325// Creates a new module which looks like:
326326//
327+ // #[doc(hidden)]
327328// mod $gensym {
328329// extern crate proc_macro;
329330//
@@ -357,6 +358,10 @@ fn mk_decls(
357358 } ) ;
358359 let span = DUMMY_SP . apply_mark ( mark) ;
359360
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+
360365 let proc_macro = Ident :: from_str ( "proc_macro" ) ;
361366 let krate = cx. item ( span,
362367 proc_macro,
@@ -421,7 +426,7 @@ fn mk_decls(
421426 span,
422427 span,
423428 ast:: Ident :: with_empty_ctxt ( Symbol :: gensym ( "decls" ) ) ,
424- vec ! [ ] ,
429+ vec ! [ doc_hidden ] ,
425430 vec ! [ krate, decls_static] ,
426431 ) . map ( |mut i| {
427432 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