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

rustfmt ignores #![rustfmt::skip] when run with -r #4206

Closed
topecongiro opened this issue May 25, 2020 · 0 comments · Fixed by #4207
Closed

rustfmt ignores #![rustfmt::skip] when run with -r #4206

topecongiro opened this issue May 25, 2020 · 0 comments · Fixed by #4207
Labels
a-rustfmt::skip bug Panic, non-idempotency, invalid code, etc. p-high
Milestone

Comments

@topecongiro
Copy link
Contributor

Given the following project structure,

.
├── Cargo.lock
├── Cargo.toml
└── src
    ├── foo.rs
    └── main.rs
// main.rs
mod foo;

fn main() {
    println!("Hello, world!");
}
// foo.rs
#![rustfmt::skip]

fn
foo()
{}

rustfmt src/main.rs -c and rustfmt src/foo.rs -c succeeds but rustfmt -cr src/main.rs will fail with the following output:

Diff in /tmp/skip/src/foo.rs:1:
 #![rustfmt::skip]
 
-fn
-foo()
-{}
+fn foo() {}
 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a-rustfmt::skip bug Panic, non-idempotency, invalid code, etc. p-high
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant