-
Notifications
You must be signed in to change notification settings - Fork 898
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
Rustfmt deletes comments in 'use {}' #4708
Labels
Comments
calebcartwright
added
a-comments
a-imports
`use` syntax
1x-backport:pending
Fixed/resolved in source but not yet backported to a 1x branch and release
and removed
bug
Panic, non-idempotency, invalid code, etc.
labels
Feb 24, 2021
Here's a slightly more common example of where this bug results in an annoyance: pub use serenity::model::{
// channel::{Message, Reaction, ReactionType},
// gateway::Ready,
// guild::{Member, Role},
// id::{ChannelId, GuildId, MessageId, RoleId, UserId},
// permissions::Permissions,
prelude::*,
// user::User,
}; Upon invoking rustfmt, all the commented-out lines disappeared |
repro'd with 1.4.38 |
calebcartwright
removed
the
1x-backport:pending
Fixed/resolved in source but not yet backported to a 1x branch and release
label
Oct 30, 2021
Is this the same as #3984? |
@AndrewKvalheim it seems like they are the same. Thanks for pointing that out 😁 |
Closed
This was completed in #5853 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
To Reproduce
run rustfmt on the following code:
use {std::env::args /* this comment gets removed */};
fn main() {println!("hello from {}!", args().next().unwrap());}
Expected behavior
comment should be preserved
Meta
The text was updated successfully, but these errors were encountered: