-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't ignore clippy::borrow_deref_ref #8971
Comments
Related to #7930 I guess |
Fixing this is waiting on #8694. In the meantime you can allow at the module or crate level. |
rust-lang/rust#97660 is also related to this, as the lint is currently not emitted at the correct location. |
Is there a reason this lint tends to be emitted with pyO3 projects? I am running in to the same thing on a python crate and scratching my head a bit Even simpler for me, I don't even use the #[pyfunction]
#[inline]
fn levenshtein(a: &str, b: &str, limit: Option<u32>) -> u32 {
match limit {
Some(v) => algorithms::levenshtein_limit(a, b, v),
None => algorithms::levenshtein(a, b),
}
} |
That is most likely a problem originating from the |
I can still confirm on latest rust 1.63.0 stable clippy that fucntions implmented within a #[pymethods]
impl _FdDataLoader {
// ...
fn start_epoch(&mut self, split: &str, seed: usize) -> PyResult<()> {
// ...
}
}
|
The PR #8694 took a longer time to review. It should hit stable in two releases, so by 1.65. The lint mentioned didn't get an extra check, though. Adding it should be simple with the new util functions from of the PR. (See @rustbot label +good-first-issue |
It is caused by same bug in clippy rust-lang/rust-clippy#8971
Hi! I am trying to simulate the clippy warning here because I want to try to solve this issue. But I am having hard time to reproduce the lint warn. Can you please help me out? The code sample that I am using to try to reproduce is:
Just want to be sure if this snippet should trigger the lint warn or not. If not, can you try to provide another small snippet that triggers the warning? PS: I am using pyo3 v0.18.3 |
I would guess that the triggering code has been fixed in |
Hey @xFrednet thanks for pointing out! I have added similar check to another lint, so I guess that I will be able to add here as well. I just wanted to try to reproduce the problem with pyo3 before, to make sure that the Anyway, I will continue here with the @rustbot claim |
Summary
We have this function in our crate https://github.com/AFLplusplus/LibAFL/tree/main/libafl
https://github.com/AFLplusplus/LibAFL/blob/main/libafl/src/observers/mod.rs#L816
and clippy gives this warning
We actually have allow(clippy::all) on this function, but still the clippy gives this error and it's not ignored.
Lint Name
borrow_deref_ref
Reproducer
You can clone the repo https://github.com/AFLplusplus/LibAFL/tree/main/libafl
and checkout to debug_restarting branch
and run
or simply
Version
Additional Labels
No response
The text was updated successfully, but these errors were encountered: