Open
Description
I tried this code:
/// The default value of the setting normally matches the
/// [`Default`] trait. If you want to specify a
#[proc_macro_derive(Gui, attributes(default, heading_level))]
pub fn settings_macro(input: TokenStream) -> TokenStream { ... }
When running cargo doc
I expected to see this happen:
The Default
trait is linked.
Instead, this happened:
The Default
is not properly linked. There is no warning in the cargo doc
output.
If I change it to:
/// The default value of the setting normally matches the
/// [`Default`](core::default::Default) trait. If you want to specify a
/// different default you can specify it like so:
It properly gets linked:
But now there is a warning:
warning: redundant explicit link target
--> asr-derive\src\lib.rs:46:17
|
46 | /// [`Default`](core::default::Default) trait. If you want to specify a
| --------- ^^^^^^^^^^^^^^^^^^^^^^ explicit target is redundant
| |
| because label contains path that resolves to same destination
|
= note: when a link's destination is not specified,
the label is used to resolve intra-doc links
= note: `#[warn(rustdoc::redundant_explicit_links)]` on by default
help: remove explicit link target
|
46 | /// [`Default`] trait. If you want to specify a
| ~~~~~~~~~~~
Meta
rustc --version --verbose
:
rustc 1.73.0 (cc66ad468 2023-10-03)
binary: rustc
commit-hash: cc66ad468955717ab92600c770da8c1601a4ff33
commit-date: 2023-10-03
host: x86_64-pc-windows-msvc
release: 1.73.0
LLVM version: 17.0.2
Backtrace