rust-lang / rust-lang/rust

Module items not in scoped for module `//!` comment when module also has `///` comment

Open
#134,904 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-intra-doc-links C-bug S-has-mcve T-rustdoc
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

Not very clear how //! in top of module or /// before 'mod' declaration works and what difference. I found one big difference when doing /// then in rest of //! at top of module, module items are not in the scoped.

I understand it's normal module importer doesnt ahve module items in scoped by default. But its not normal that module itself doesnt have items in the scoped.

Smallest reproduction case: https://github.com/xmppftw/rustrepro/tree/issue-134904

  • maybe it's a bug?
  • maybe it's bad to use /// and //! but i dont see this in rustdoc book or somewhere else

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 linked smallest reproduction case and compare module item scoping when a module has a //! comment versus a /// comment before its mod declaration. Check the rustdoc book or related documentation for the intended behavior, then establish whether the reproduction is expected or needs a compiler fix and add a focused regression test or documentation clarification accordingly.

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
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.