Open
Description
Rustdoc only emits a documentation page for my_macro
as a macro; there's no function page for it.
Note that the link indeed fails to resolve.
Code
//! Link to [`my_macro`].
#![crate_type = "proc-macro"]
extern crate proc_macro;
#[proc_macro]
pub fn my_macro(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
input
}
Output
warning: `my_macro` is both a function and a macro
--> foo.rs:1:15
|
1 | //! Link to [`my_macro`].
| ^^^^^^^^ ambiguous link
|
= note: `#[warn(rustdoc::broken_intra_doc_links)]` on by default
help: to link to the function, add parentheses
|
1 | //! Link to [`my_macro()`].
| ++
help: to link to the macro, add an exclamation mark
|
1 | //! Link to [`my_macro!`].
| +
warning: 1 warning emitted