-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Open
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
If the raw pointer is used behind a type alias or the function is part of a trait, not_unsafe_ptr_arg_deref is not triggered.
Lint Name
not_unsafe_ptr_arg_deref
Reproducer
I tried this code:
trait Bad {
fn f(x: *const u8) -> u8 {
unsafe { *x }
}
}
type Alias = *const u8;
pub fn bad(x: Alias) -> u8 {
unsafe { *x }
}
pub fn main() {
bad(0 as _);
}I expected to see this happen: Lint for not_unsafe_ptr_arg_deref is triggered
Instead, this happened: Lint is not triggered
Version
No response
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