rust-lang / rust-lang/rust

Remaining issues after the `#[doc]` attribute port

Open
#149,865 0 comments 0 reactions 2 assignees View on GitHub

@JonathanBrouwer is already working on this.

Since Dec 10, 2025.

A-attributes C-cleanup T-rustdoc
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

From https://github.com/rust-lang/rust/pull/149645

  • Some part of cfg_old.rs are likely unused now, so they should be removed. https://github.com/rust-lang/rust/pull/149903
  • Not all error/lints are emitted at the same time anymore, making them kinda less useful considering that you need to run and fix rustc/rustdoc multiple times to get through all of them.
  • For coherency with the other attribute errors, I didn't modify the default output too much, meaning that we have some new messages now. I'll likely come back to that to check if the previous ones were better in a case-by-case approach.
  • doc(test(attr(...))) is handled in a horrifying manner currently. Until we can handle it correctly with the Attribute system, it'll remain that thing we're all very ashamed of. 😈
  • Because of error reporting, some fields of Doc are suboptimal, like inline which instead of being an Option is a ThinVec because we report the error later on. Part of the things I'm not super happy about but can be postponed to future me.
  • In src/librustdoc/clean/cfg.rs, the pub(crate) fn parse(cfg: &MetaItemInner) -> Result<Cfg, InvalidCfgError> { function should be removed once cfg_trace has been ported to new cfg API. https://github.com/rust-lang/rust/pull/150092
  • Size of type DocFragment went from 32 to 48. Would be nice to get it back to 32.
  • malformed `doc` attribute input wasn't meant for so many candidates, should be improved. https://github.com/rust-lang/rust/pull/149917
  • See how many of the checks in check_attr we can move to attribute parsing
  • Port target checking to be in the attribute parser completely
  • Fix target checking for doc(alias) on fields & patterns
  • See if we can use InvalidTarget instead of AttributeLintKind::AttrCrateLevelOnly and DocAttrNotCrateLevel

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.