Skip to content

In test builds, expect(clippy::missing_inline_in_public_items) does not function properly #13394

@kpreid

Description

@kpreid

Summary

In test builds, an expect(clippy::missing_inline_in_public_items) will report “this lint expectation is unfulfilled” even in cases where warn(clippy::missing_inline_in_public_items) would warn and therefore the expectation should be fulfilled.

Lint Name

missing_inline_in_public_items

Reproducer

I tried this code with cargo clippy --tests:

#![warn(clippy::missing_inline_in_public_items)] #[expect(clippy::missing_inline_in_public_items)] pub fn foo() -> u32 { 0 }

I saw this happen:

warning: this lint expectation is unfulfilled --> src/lib.rs:3:10 | 3 | #[expect(clippy::missing_inline_in_public_items)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: `#[warn(unfulfilled_lint_expectations)]` on by default 

I expected to see this happen: No diagnostic

Version

rustc 1.83.0-nightly (adaff5368 2024-09-12) binary: rustc commit-hash: adaff5368b0c7b328a0320a218751d65ab1bba97 commit-date: 2024-09-12 host: x86_64-apple-darwin release: 1.83.0-nightly LLVM version: 19.1.0 

Additional Labels

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: Clippy is not doing the correct thingI-false-positiveIssue: The lint was triggered on code it shouldn't have

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions