unwrap_used
/expect_used
fire in test module function regardless of allow-unwrap-in-tests
/allow-expect-in-tests
#9612
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
Summary
Functions inside modules with
#[cfg(test)]
that are themselves not#[test]
functions are linted forunwrap_used
andexpect_used
even whenclippy.toml
setsallow-unwrap-in-tests = true
andallow-expect-in-tests = true
.Lint Name
unwrap_used & expect_used
Reproducer
I tried this code:
main.rs
clippy.toml
I saw this happen:
I expected to see this happen: Lints should not fire for lines 22 and 23, since unwrap and expect should be allowed in tests and these lines are part of a test module.
Version
Additional Labels
config feature was introduced in #8802
The text was updated successfully, but these errors were encountered: