Polish `missing_doc_code_examples` tests and the lint itself
@GuillaumeGomez is already working on this.
Since Mar 31, 2026.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
@lolbinarycat made a very detailed list of what remains to be done for this lint to be complete here. I will not mark this issue as E-Easy or as mentored because some points here will require discussions with the team.
From those mentioned in the above PR (checked=tests exist):
- Impl blocks
- Enum variants
- Struct/union fields
- (associated) Type aliases
- Statics/constants
- Modules
- Inlined reexports (cross-crate)
- Inlined reexports (intra-crate)
- Non-inlined reexports (cross-crate)
- Non-inlined reexports (intra-crate)
- Inherient associated constants
- Trait associated constants
- Required trait associated types
- Optional trait associated types
Additional tests needed:
- All 3 kinds of macros (v2,
macro_rules,proc_macro). Currently these (at leastmacro_rulesmacros) are not linted on, but there's a solid argument they should be. - Trait definitions
- Trait items in a trait definition (all of them, including both required and non-required methods)
pub extern crateitems.- Everything that can appear in an
externblock (functions, statics, and types)
In addition to all this: private/hidden items are not checked (also clarify if that behavior is changed by --document-private-items and/or --document-hidden-items).
Additionally, we should clarify what counts as a "code example". Does it have to be a doctest (i.e. does ignore not count)? Any rust code block? Any code block? Once we decide on a behavior we want, we'll also need tests for that behavior.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.