rust-lang / rust-lang/rust

`doc_auto_cfg` assigns wrong feature to cyclically reexported impl

Open
#143,318 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-bug F-doc_cfg T-rustdoc
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

Code

Reproducer in https://github.com/alexveecle/cyclic_doc_auto_cfg

Reproduction Steps

Run cargo doc --all-features and review target/doc/facade/facade_main/foo/struct.Foo.html.

Expected Outcome

The foo function should not be associated to the supporting feature.

Actual Output

Screenshot of the HTML showing the association to the supporting feature.

Version

rustdoc 1.90.0-nightly (28f1c8079 2025-06-24)

Additional Details

We found this issue with a facade crate that reexports other crate modules. The supporting crate also reexports parts of the main crate, which seems to cause this issue.

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 with the reproducer at https://github.com/alexveecle/cyclic_doc_auto_cfg and run cargo doc --all-features. Inspect target/doc/facade/facade_main/foo/struct.Foo.html to trace why foo is associated with supporting; done means the function is no longer associated with that feature.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.