Closed
Description
I tried this code:
//! [str::trim()]
I expected to see this happen: Rustdoc links to https://doc.rust-lang.org/nightly/std/primitive.str.html#method.trim.
Instead, this happened: Rustdoc gets confused that ()
means a function and thinks that the link is a primitive.
error: incompatible link kind for `str::trim`
|
|
57 | /// Using the [`str::trim()`] method ensures that no whitespace remains before parsing.
| ^^^^^^^^^^^^^ help: to link to the builtin type, prefix with `prim@`: ``prim@str::trim``
|
= note: `-D broken-intra-doc-links` implied by `-D warnings`
= note: this link resolved to a builtin type, which is not a function
Meta
rustdoc --version
:
rustdoc 1.50.0-beta.1 (05b602367 2020-12-29)
Relevant code:
I think the fix is just to add if self.kind_side_channel.is_none()
as a match guard.
Metadata
Metadata
Assignees
Labels
Area: Intra-doc links, the ability to link to items in docs by nameCategory: This is a bug.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Relevant to the rustdoc team, which will review and decide on the PR/issue.