-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
needless_pass_by_ref_mut
false positive
#11179
Labels
C-bug
Category: Clippy is not doing the correct thing
I-false-positive
Issue: The lint was triggered on code it shouldn't have
I-suggestion-causes-error
Issue: The suggestions provided by this Lint cause an ICE/error when applied
Comments
iamsauravsharma
added
C-bug
Category: Clippy is not doing the correct thing
I-false-positive
Issue: The lint was triggered on code it shouldn't have
labels
Jul 18, 2023
Minimal reproducible example: async fn f(x: &mut i32) {
*x += 1;
} Looks like it doesn't work correctly in async fns. |
Also, It works properly if you add extra parameter which are not stored in heap? (not sure) // no issue
async fn _f(x: &mut i32, _p: i32) {
*x += 1;
} and doesn't work with heap based parameter? (not sure) async fn _g(x: &mut i32, _p: String) {
*x += 1;
}
async fn _h(x: &mut i32, _p: Vec<i32>, _q: Box<u64>) {
*x += 1;
} |
Thanks! Taking a look. |
I opened #11184 to fix this issue. |
@rustbot label +I-suggestion-causes-error |
rustbot
added
the
I-suggestion-causes-error
Issue: The suggestions provided by this Lint cause an ICE/error when applied
label
Jul 22, 2023
bors
added a commit
that referenced
this issue
Jul 22, 2023
… r=llogiq Fix async functions handling for `needless_pass_by_ref_mut` lint Fixes #11179. The problem with async is that "internals" are actually inside a closure from the `ExprUseVisitor` point of view, meaning we need to actually run the check on the closures' body as well. r? `@llogiq`
1 task
5 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
C-bug
Category: Clippy is not doing the correct thing
I-false-positive
Issue: The lint was triggered on code it shouldn't have
I-suggestion-causes-error
Issue: The suggestions provided by this Lint cause an ICE/error when applied
Summary
I got
even when connection is used as mutable https://github.com/iamsauravsharma/sqlx_migrator/blob/master/src/migrator/any.rs#L36
GitHub actions error https://github.com/iamsauravsharma/sqlx_migrator/actions/runs/5583309753/jobs/10203493083
Lint Name
needless_pass_by_ref_mut
Reproducer
Expects no error since connection is used mutably and using as suggestion doesn't compile code
Version
Additional Labels
No response
The text was updated successfully, but these errors were encountered: