You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've toying around a bit with how and where to document things. For this I've tried to reexport things at certain locations. To let the documentation appear on the reexported location I've been using #[doc(inline)]. This works fine for normal items, but fails for macros generated by macro rules and for custom derives. They are continued to be rendered just as reexports.
Reproducing example:
/// itempubstructSomeItem{i:i32}/// some macro#[macro_export]macro_rules! foo {($i: ident) => {}}/// foopubmod bar {#[doc(inline)]pubusesuper::SomeItem;#[doc(inline)]pubuse foo;}
Resulting docs for bar:
I would expect that the documentation appears inline similar like the documentation of SomeItem.
Hey @QuietMisdreavus as you implemented the doc(inline) support for macros in #51611, do you have any idea why that is not working?
(I have the same problem as @weiznich)
@bkchr See the PR I've opened. That does fix the problem for me. (It basically worked, but missed some pieces to do the actual inlining in case of macros.)
For derives, it was deliberate to only have them appear as re-exports. The documentation information disappears when the proc-macro is sent between crates, so any re-export page would be completely blank other than the name of the derive. For macro_rules! macros, i'm less sure about those. I'll take a look at the PR.
Activity
bkchr commentedon Nov 28, 2018
Hey @QuietMisdreavus as you implemented the
doc(inline)support for macros in #51611, do you have any idea why that is not working?(I have the same problem as @weiznich)
weiznich commentedon Nov 28, 2018
@bkchr See the PR I've opened. That does fix the problem for me. (It basically worked, but missed some pieces to do the actual inlining in case of macros.)
bkchr commentedon Nov 28, 2018
@weiznich nice :)
QuietMisdreavus commentedon Dec 3, 2018
For derives, it was deliberate to only have them appear as re-exports. The documentation information disappears when the proc-macro is sent between crates, so any re-export page would be completely blank other than the name of the derive. For
macro_rules!macros, i'm less sure about those. I'll take a look at the PR.Rollup merge of rust-lang#56315 - weiznich:rustdoc_inline_macro_reexp…