manual_memcpy
lints against slices but not pointer arythmetics
#13859
Labels
C-bug
Category: Clippy is not doing the correct thing
I-false-negative
Issue: The lint should have been triggered on code, but wasn't
Summary
manual_memcpy
should be able to suggest usingcore::ptr::copy_nonoverlapping
when relevantLint Name
manual_memcpy
Reproducer
I tried this code:
I expected to see this happen:
Clippy should suggest to replace it with the following (maybe using
core::ptr::copy
if clippy can't assert from type information (such as one being a mutable reference) that the pointers don't overlap).Instead, this happened:
The cilppy lints
needless_range_loops
was triggered:Version
The text was updated successfully, but these errors were encountered: