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

infallible_destructuring_match misses ref in suggested fix #7499

Closed
chevdor opened this issue Jul 28, 2021 · 3 comments · Fixed by #9850
Closed

infallible_destructuring_match misses ref in suggested fix #7499

chevdor opened this issue Jul 28, 2021 · 3 comments · Fixed by #9850

Comments

@chevdor
Copy link

chevdor commented Jul 28, 2021

I am using clippy 0.1.55 (88539999 2021-07-06).

The suggestion given for:

let t1 = match type_section.types()[1] {
   Type::Function(ref func_type) => func_type
};

is:

let Type::Function(t1) = type_section.types()[1];

it should actually include the ref:

let Type::Function(ref t1) = type_section.types()[1];
@giraffate
Copy link
Contributor

Can you provide a minimal reproduction on the playground?

@chevdor
Copy link
Author

chevdor commented Aug 5, 2021

This issue appears to be fixed in clippy 0.1.56 (49272389 2021-07-29)

@chevdor chevdor closed this as completed Aug 5, 2021
@pheki
Copy link
Contributor

pheki commented Nov 15, 2022

Also bumped into this yesterday, seems that it isn't fixed yet: playground link

bors added a commit that referenced this issue Nov 18, 2022
Preserve `ref` on `infallible_destructuring_match` suggestion

Fixes #7499

changelog: [`infallible_destructuring_match`]: Preserve `ref` on suggestion
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

Successfully merging a pull request may close this issue.

3 participants