-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
borrow_as_ptr
should detect &expr
in places where that is coerced to a raw pointer, and suggest &raw const expr
instead (and similar for the mutable case)
Lint Name
borrow_as_ptr
Reproducer
I tried this code:
#![deny(clippy::borrow_as_ptr)]
fn main() {
let val = 1;
let p: *const i32 = &val;
}
I expected to see this happen:
the lint should fire
Instead, this happened:
it does not fire
Version
Clippy 0.1.85 (2025-02-17 4d91de4e48) on the playground
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