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

Global skip attribute is ignored #4344

Closed
stanislav-tkach opened this issue Jul 22, 2020 · 1 comment
Closed

Global skip attribute is ignored #4344

stanislav-tkach opened this issue Jul 22, 2020 · 1 comment
Labels
bug Panic, non-idempotency, invalid code, etc.

Comments

@stanislav-tkach
Copy link
Contributor

Describe the bug

It seems that #![rustfmt::skip] is ignored. I'm not sure if this attribute is broken completely, but I was able to reduce code to the minimum and rustfmt still formats the code. Originally I encountered this issue in the rust-protobuf project where generated files contain the global skip attribute: stepancheg/rust-protobuf#511

To Reproduce
Run cargo fmt for the following code:

#![rustfmt::skip]

#[derive(PartialEq,Clone,Default)]
pub struct TestMessage {
}

Expected behavior

I expect no changes after cargo fmt and no output after the cargo fmt -- --check command.

Meta

  • rustfmt version: rustfmt 1.4.15-stable (530eadf 2020-06-02)
  • From where did you install rustfmt?: rustup
  • How do you run rustfmt: cargo fmt
@stanislav-tkach stanislav-tkach added the bug Panic, non-idempotency, invalid code, etc. label Jul 22, 2020
@topecongiro
Copy link
Contributor

Thank you for filing an issue. The issue is fixed in the latest development branch and the nightly channel, but unfortunately, the latest stable channel missed the fix.

The rustup release team will backport the fix; please follow this issue to track the progress.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Panic, non-idempotency, invalid code, etc.
Projects
None yet
Development

No branches or pull requests

2 participants