Skip to content

fix: missing_docs_in_private_items unfulfilling #[expect] in test mode - #16938

Closed
Kokoro2336 wants to merge 1 commit into
rust-lang:masterfrom
Kokoro2336:fix/is-missing-doc
Closed

Kokoro2336 wants to merge 1 commit into
rust-lang:masterfrom
Kokoro2336:fix/is-missing-doc

Conversation

@Kokoro2336

@Kokoro2336 Kokoro2336 commented Apr 30, 2026 •

Copy link
Copy Markdown
Contributor

changelog: fix [missing_docs_in_private_items]: unfulfilling #[expect] in test mode

Fixes #16934

@Kokoro2336
Kokoro2336 marked this pull request as ready for review April 30, 2026 11:27
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Apr 30, 2026
@rustbot

rustbot commented Apr 30, 2026

Copy link
Copy Markdown
Collaborator

r? @llogiq

rustbot has assigned @llogiq.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: 7 candidates
  • 7 candidates expanded to 7 candidates
  • Random selection from Jarcho, dswij, llogiq

@blyxyas

blyxyas commented Aug 13, 2026

Copy link
Copy Markdown
Member

r? @blyxyas

@rustbot rustbot assigned blyxyas and unassigned llogiq Aug 13, 2026

@blyxyas blyxyas left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a great starting point, just a small change (ㅇㅅㅇ❀)

View changes since this review

Comment thread clippy_lints/src/missing_doc.rs Outdated
fn is_missing_docs(&self, cx: &LateContext<'_>, def_id: LocalDefId, hir_id: HirId) -> bool {
if cx.tcx.sess.opts.test {
// Ignore every item in a test module or a #[test] annotated function
if is_in_test(cx.tcx, hir_id) || is_cfg_test(cx.tcx, hir_id) || is_test_function(cx.tcx, def_id) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should maintain the original option check.

Suggested change
if is_in_test(cx.tcx, hir_id) || is_cfg_test(cx.tcx, hir_id) || is_test_function(cx.tcx, def_id) {
if cx.tcx.sess.opts.test || is_in_test(cx.tcx, hir_id) || is_cfg_test(cx.tcx, hir_id) || is_test_function(cx.tcx, def_id) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@blyxyas But I think a non-test item should also be linted even if there's a opts.test flag.

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status) and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties labels Aug 13, 2026
@rustbot

rustbot commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

Reminder, once the PR becomes ready for a review, use @rustbot ready.

fix(missing-doc): filter logic.

test: supply test mode uitest.
@rustbot

rustbot commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@blyxyas

blyxyas commented Aug 15, 2026

Copy link
Copy Markdown
Member

Hmm seems that test are falling...

@blyxyas

blyxyas commented Sep 7, 2026

Copy link
Copy Markdown
Member

Ping @Kokoro2336 🏓 , could you fix CI?

@rustbot

rustbot commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator

☔ The latest upstream changes (possibly #17714) made this pull request unmergeable. Please resolve the merge conflicts.

@blyxyas

blyxyas commented Sep 28, 2026

Copy link
Copy Markdown
Member

@Kokoro2336, I'm going to close this PR as stale because it seems you've been inactive. If you ever come back, please re-open this PR or open a new one.

@blyxyas blyxyas closed this Sep 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

#[expect(clippy::missing_docs_in_private_items)] causes unfulfilled_lint_expectations when building tests

4 participants