Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rustdoc: is there a way to link to public macros without going through the crate root? #113718

Closed
rufo1 opened this issue Jul 15, 2023 · 1 comment
Labels
A-intra-doc-links Area: Intra-doc links, the ability to link to items in docs by name A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)

Comments

@rufo1
Copy link

rufo1 commented Jul 15, 2023

          In that case, is there a way to force linking to a macro in a specific path instead of resolving to the crate root? I'm finding it makes some docs weird when the text says one thing but the link goes somewhere else.

Originally posted by @ChrisDenton in #72243 (comment)

@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jul 15, 2023
@jyn514 jyn514 added A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) A-intra-doc-links Area: Intra-doc links, the ability to link to items in docs by name labels Jul 15, 2023
@jyn514
Copy link
Member

jyn514 commented Jul 15, 2023

@rufo1 the way to do this is with decl-macros, which are still unstable.

#![feature(decl_macro)]
//! link to [inner::foo]
pub mod inner {
    pub macro foo() {}
}

image

@jyn514 jyn514 changed the title In that case, is there a way to force linking to a macro in a specific path instead of resolving to the crate root? I'm finding it makes some docs weird when the text says one thing but the link goes somewhere else. rustdoc: is there a way to link to public macros without going through the crate root? Jul 15, 2023
@jyn514 jyn514 removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jul 15, 2023
@rufo1 rufo1 closed this as completed Sep 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-intra-doc-links Area: Intra-doc links, the ability to link to items in docs by name A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)
Projects
None yet
Development

No branches or pull requests

3 participants