Skip to content

Removed comment on save #10643

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

Closed
ralpha opened this issue Oct 26, 2021 · 3 comments
Closed

Removed comment on save #10643

ralpha opened this issue Oct 26, 2021 · 3 comments

Comments

@ralpha
Copy link

ralpha commented Oct 26, 2021

When I save my code in VSCode it auto-formats the code on save.
This always works correctly. But with the following code it removed the comment:

pub trait MyTrait
where
    Self: Sized,
// some comment
{

}

Once this is saved it will have saved:

pub trait MyTrait
where
    Self: Sized,
{

}

This seems to always happen when there is a where part to the trait.

I don't expect my comment to be deleted, even if it is not a valid/recommended place to put a comment.

@bjorn3
Copy link
Member

bjorn3 commented Oct 26, 2021

This is a rustfmt issue. Can you please open an issue at https://github.com/rust-lang/rustfmt instead?

@ralpha
Copy link
Author

ralpha commented Oct 26, 2021

Yes, will do

@ralpha ralpha closed this as completed Oct 26, 2021
@ralpha
Copy link
Author

ralpha commented Oct 26, 2021

Found already existing issue there, so did not create a new one.
rust-lang/rustfmt#4649

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