Skip to content
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

almost_swapped false positive? #10721

Closed
rjzak opened this issue Apr 27, 2023 · 2 comments
Closed

almost_swapped false positive? #10721

rjzak opened this issue Apr 27, 2023 · 2 comments

Comments

@rjzak
Copy link

rjzak commented Apr 27, 2023

Description

Code which receives a parameter with the ref keyword claimed by clippy to be a swap.

Ref: enarx/drawbridge#423

Example:

pub async fn query(
    Extension(ref store): Extension<Arc<Store>>,
    ref cx: RepositoryContext,
    req: Request<Body>,
) -> impl IntoResponse { ..... }

Claims that ref cx: RepositoryContext, is a swap.

Version

rustc 1.69.0 (84c898d65 2023-04-16)
binary: rustc
commit-hash: 84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc
commit-date: 2023-04-16
host: x86_64-unknown-linux-gnu
release: 1.69.0
LLVM version: 15.0.7

Additional Labels

No response

@lukaslueg
Copy link
Contributor

I don't quite see why TOPLEVEL_REF_ARG doesn't fire here!?

@rjzak
Copy link
Author

rjzak commented Jun 2, 2023

Seems to be fixed by #10499. We're no longer having this issue.

@rjzak rjzak closed this as completed Jun 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants