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

False positive when swapping elements of a matrix #4853

Closed
krishna-veerareddy opened this issue Nov 27, 2019 · 1 comment · Fixed by #4877
Closed

False positive when swapping elements of a matrix #4853

krishna-veerareddy opened this issue Nov 27, 2019 · 1 comment · Fixed by #4877
Labels
C-bug Category: Clippy is not doing the correct thing I-suggestion-causes-error Issue: The suggestions provided by this Lint cause an ICE/error when applied L-suggestion Lint: Improving, adding or fixing lint suggestions

Comments

@krishna-veerareddy
Copy link
Contributor

Clippy(clippy 0.0.212 (3aea860 2019-09-03)) incorrectly suggests to use std::mem::swap when trying to swap elements of a matrix across different rows. The lint is clippy::manual_swap.

Here's a minimal example:

fn swap(a: &mut[Vec<u64>]) {
    let tmp = a[0][1];

    a[0][1] = a[1][0];
    a[1][0] = tmp;
}
@flip1995
Copy link
Member

It seems like #981 wasn't fixed completely.

@flip1995 flip1995 added L-suggestion Lint: Improving, adding or fixing lint suggestions C-bug Category: Clippy is not doing the correct thing I-suggestion-causes-error Issue: The suggestions provided by this Lint cause an ICE/error when applied labels Nov 28, 2019
@bors bors closed this as completed in c66cca4 Dec 3, 2019
@bors bors closed this as completed in #4877 Dec 3, 2019
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-suggestion-causes-error Issue: The suggestions provided by this Lint cause an ICE/error when applied L-suggestion Lint: Improving, adding or fixing lint suggestions
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants