-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
C-bugCategory: Clippy is not doing the correct thingCategory: Clippy is not doing the correct thingI-false-negativeIssue: The lint should have been triggered on code, but wasn'tIssue: The lint should have been triggered on code, but wasn't
Description
Summary
Doesn't trigger on expect. Noticed when changing from unwrap to expect to provide a better message, and the lint was suddenly gone.
Lint Name
missing_panics_doc
Reproducer
I tried this code:
#[deny(clippy::missing_panics_doc)]
pub fn last_unwrap(v: &[u32]) -> u32 {
*v.last().unwrap()
}
pub fn last_expect(v: &[u32]) -> u32 {
*v.last().expect("passed an empty thing")
}I expected to see this happen: issue error for both last_unwrap and last_expect.
Instead, this happened:
Version
rustc 1.67.0 (fc594f156 2023-01-24)
binary: rustc
commit-hash: fc594f15669680fa70d255faec3ca3fb507c3405
commit-date: 2023-01-24
host: x86_64-unknown-linux-gnu
release: 1.67.0
LLVM version: 15.0.6
Metadata
Metadata
Assignees
Labels
C-bugCategory: Clippy is not doing the correct thingCategory: Clippy is not doing the correct thingI-false-negativeIssue: The lint should have been triggered on code, but wasn'tIssue: The lint should have been triggered on code, but wasn't
