Closed
Description
I tried this code:
/// [`bar`]
#[macro_export]
macro_rules! foo {
() => {};
}
/// [`foo`]
#[macro_export]
macro_rules! bar {
() => {};
}
I expected to see this happen: No warning is reported by cargo doc
.
Instead, this happened: The following warning is reported:
warning: unresolved link to `bar`
--> src/issue.rs:1:7
|
1 | /// [`bar`]
| ^^^ no item named `bar` in scope
|
= note: `#[warn(rustdoc::broken_intra_doc_links)]` on by default
= note: `macro_rules` named `bar` exists in this crate, but it is not in scope at this link's location
Despite the warning, the generated link does work as expected.
This does not happen if I change [`bar`]
to [`crate::bar`]
.
Meta
rustc --version --verbose
:
rustc 1.64.0-nightly (46b8c23f3 2022-07-01)
binary: rustc
commit-hash: 46b8c23f3eb5e4d0e0aa27eb3f20d5b8fc3ed51f
commit-date: 2022-07-01
host: aarch64-apple-darwin
release: 1.64.0-nightly
LLVM version: 14.0.6