Skip to content

missing-docs lint reports on #[test] macro #130216

Closed

Description

I tried this code:

#![deny(missing_docs)]

//! Docs

#[test]
fn foo() {}

I expected to see this happen: no errors

Instead, this happened:

> cargo check --all-targets
error: missing documentation for a constant
 --> src/lib.rs:6:1
  |
5 | #[test]
  | ------- in this procedural macro expansion
6 | fn foo() {}
  | ^^^^^^^^^^^
  |
note: the lint level is defined here
 --> src/lib.rs:1:9
  |
1 | #![deny(missing_docs)]
  |         ^^^^^^^^^^^^
  = note: this error originates in the attribute macro `test` (in Nightly builds, run with -Z macro-backtrace for more info)

Meta

rustc --version --verbose:

rustc 1.83.0-nightly (0ee7cb5e3 2024-09-10)
binary: rustc
commit-hash: 0ee7cb5e3633502d9a90a85c3c367eccd59a0aba
commit-date: 2024-09-10
host: x86_64-unknown-linux-gnu
release: 1.83.0-nightly
LLVM version: 19.1.0

Very likely to be #130025 related

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    A-lintArea: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions