Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nightly-2024-09-11 #[test] code complains about missing_docs when missing-docs = "deny" lint is configured #130240

Closed
ytmimi opened this issue Sep 11, 2024 · 1 comment

Comments

@ytmimi
Copy link
Contributor

ytmimi commented Sep 11, 2024

When trying to run tests with cargo +nightly-2024-09-11 test I'm seeing errors when the missing-docs = "deny" lint is configured in Cargo.toml.

I've put together this minimal repo that reproduces the issue:

I tried running:

cargo +nightly-2024-09-11 test                                       

I believe this is happening because of the test macro expansion and the recent changes to emit missing_doc lints during tests (33855f8)

Meta

rustc --version --verbose:

rustc 1.83.0-nightly (0ee7cb5e3 2024-09-10)
binary: rustc
commit-hash: 0ee7cb5e3633502d9a90a85c3c367eccd59a0aba
commit-date: 2024-09-10
host: aarch64-apple-darwin
release: 1.83.0-nightly
LLVM version: 19.1.0
Backtrace

   Compiling deny_missing_docs v0.1.0 (deny_missing_docs)
error: missing documentation for the crate
 --> src/main.rs:1:1
  |
1 | / fn main() {
2 | |     println!("Hello, world!");
3 | | }
  | |_^
  |
  = note: requested on the command line with `-D missing-docs`

error: missing documentation for the crate
 --> tests/integration.rs:1:1
  |
1 | / #[test]
2 | | fn do_nothing() {}
  | |__________________^
  |
  = note: requested on the command line with `-D missing-docs`

error: could not compile `deny_missing_docs` (bin "deny_missing_docs") due to 1 previous error
warning: build failed, waiting for other jobs to finish...
error: missing documentation for a constant
 --> tests/integration.rs:2:1
  |
1 | #[test]
  | ------- in this procedural macro expansion
2 | fn do_nothing() {}
  | ^^^^^^^^^^^^^^^^^^
  |
  = note: this error originates in the attribute macro `test` (in Nightly builds, run with -Z macro-backtrace for more info)

error: could not compile `deny_missing_docs` (bin "deny_missing_docs" test) due to 1 previous error
error: could not compile `deny_missing_docs` (test "integration") due to 2 previous errors

@ytmimi ytmimi added the C-bug Category: This is a bug. label Sep 11, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Sep 11, 2024
@ytmimi ytmimi changed the title nightly-2024-09-11 #[test] code complains about missing_docs when missing-docs = "deny" nightly-2024-09-11 #[test] code complains about missing_docs when missing-docs = "deny" lint is configured Sep 11, 2024
@Urgau
Copy link
Member

Urgau commented Sep 11, 2024

Duplicate of #130216, which will be fixed by #130219

@Urgau Urgau closed this as completed Sep 11, 2024
@Urgau Urgau removed C-bug Category: This is a bug. needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Sep 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants