Open its-the-shrimp opened 1 month ago
I'm seeing the same thing with other lints, e.g.
//! crate docs
#![warn(missing_docs)]
#[expect(missing_docs)] // warning: this lint expectation is unfulfilled
pub fn foo() {}
rust-analyzer version: 0.3.2086-standalone (7106cd3be 2024-08-25) [/Users/kpreid/.vscode/extensions/rust-lang.rust-analyzer-0.3.2086-darwin-x64/server/rust-analyzer] rustc version: 1.82.0-nightly (c6db1ca3c 2024-08-25)
Presumably this has something to do with how RA invokes the check command, but I couldn't figure out how to extract the command line to test it separately. It happens whether rust-analyzer.check.command
is set to check
or clippy
.
I'm seeing the same thing with other lints, e.g.
//! crate docs #![warn(missing_docs)] #[expect(missing_docs)] // warning: this lint expectation is unfulfilled pub fn foo() {}
rust-analyzer version: 0.3.2086-standalone (7106cd3 2024-08-25) [/Users/kpreid/.vscode/extensions/rust-lang.rust-analyzer-0.3.2086-darwin-x64/server/rust-analyzer] rustc version: 1.82.0-nightly (c6db1ca3c 2024-08-25)
Presumably this has something to do with how RA invokes the check command, but I couldn't figure out how to extract the command line to test it separately. It happens whether
rust-analyzer.check.command
is set tocheck
orclippy
.
+1 with rust stable-1.81.0
Just updated to stable 1.81 and got this.
I can reproduce it directly with cargo using cargo clippy --tests
, which also reports "this lint expectation is unfulfilled". But it doesn't happen with cargo check --tests
. :thinking:
This happens because we pass --all-targets
by default. But I don't really understand the reason why, we should probably file an issue against Clippy or rustc.
--all-targets
enables --tests
which enables the test harness generation (rustc --test
) which some lint are gated against, which means that they don't emit the lint which triggers the unfulfilled_lint_expectations
lint since it wasn't emitted
rust-analyzer version:
2024-07-22
rustc version: rustc 1.82.0-nightly (8bfcae730 2024-07-23)
editor or extension: Neovim
code snippet to reproduce:
This code is just fine with
cargo check
orcargo clippy
, but rust-analyzer emits anunfulfilled_lint_expectations
warning, even though theclippy::enum_glob_use
lint is triggered if theexpect
attribute is commented out