rust-lang / rust-lang/rust

Links to std are not rendered in in-lined docs for re-exported derive macros (unlike re-exported traits)

Open
#159,027 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-bug needs-triage T-rustdoc
Dominant language
Rust
Stars
119k
Forks
16.2k
PR merge metrics
PR metrics pending

Description

Code

in crate1:

/// Derives [`IntoIterator`](std::iter::IntoIterator) analog to [Result] & [Option].
#[proc_macro_derive(IntoIterator)]
pub fn into_iterator(input: TokenStream1) -> TokenStream1 {
    ...
}

in crate2:

/// Methods for transforming TryTypes. Inspired by the methods provided on [`Option`] & [`Result`](std::result::Result)
pub trait Transform<T> {
    ...
}

in crate0:

#[doc(inline)]
pub use crate1::*;
#[doc(inline)]
pub use crate2::*;

Reproduction Steps

Expected Outcome

Links should be rendered on re-export of derive macros just as they are on re-export of traits

Version

1.98.0-nightly

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing the linked docs.rs pages for the re-exported and direct derive-macro documentation, then trace rustdoc's handling of inlined re-exports for derive macros versus traits. Reproduce the crate0, crate1, and crate2 examples against the reported nightly version. Done means links to IntoIterator, Option, and Result render on the re-exported derive-macro page as they do for the trait.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers, documentation
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.