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

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

Open
kpreid opened this issue Sep 13, 2024 · 0 comments
Labels
C-bug Category: Clippy is not doing the correct thing I-false-positive Issue: The lint was triggered on code it shouldn't have

Comments

@kpreid
Copy link
Contributor

kpreid commented Sep 13, 2024

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

@kpreid kpreid added C-bug Category: Clippy is not doing the correct thing I-false-positive Issue: The lint was triggered on code it shouldn't have labels Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: Clippy is not doing the correct thing I-false-positive Issue: The lint was triggered on code it shouldn't have
Projects
None yet
Development

No branches or pull requests

1 participant