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

clippy --fix deleting informational comments #13692

Open
swanandx opened this issue Nov 15, 2024 · 0 comments
Open

clippy --fix deleting informational comments #13692

swanandx opened this issue Nov 15, 2024 · 0 comments
Labels
C-bug Category: Clippy is not doing the correct thing

Comments

@swanandx
Copy link

Summary

running clippy --fix is deleting comments while fixing useless_vec lint. I think this might be similar to #8528 ( not sure about the fix implementation though )

ps: i would love to work on the fix if I can get little pointers! thanks :)

Reproducer

I tried this code:

let _some_variable = vec![
    1, 2, // i'm here to stay
    3, 4, // but this one going away ;-;
]; // that is life anyways

I expected to see this happen:

let _some_variable = [1, 2, // i'm here to stay
      3, 4]; // but this one going away ;-;
// that is life anyways

Instead, this happened:

let _some_variable = [1, 2, // i'm here to stay
      3, 4]; // that is life anyways

Version

rustc 1.82.0 (f6e511eec 2024-10-15)
binary: rustc
commit-hash: f6e511eec7342f59a25f7c0534f1dbea00d01b14
commit-date: 2024-10-15
host: aarch64-apple-darwin
release: 1.82.0
LLVM version: 19.1.1

Additional Labels

No response

@swanandx swanandx added the C-bug Category: Clippy is not doing the correct thing label Nov 15, 2024
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
Projects
None yet
Development

No branches or pull requests

1 participant