Description
rusfmt
hangs when using cfg-if macro
To reproduce run rustftm main.rs
, where:
// main.rs
cfg_if::cfg_if! {
if #[cfg(not(feature = "client"))] {
if #[cfg(feature = "server")] {
}
}
}
rustfmt -V
rustfmt 1.4.18-stable (8157a3f 2020-07-15)
From the logs RUST_LOG=trace rustftm main.rs
I can see it just keeps logging:
[2020-09-29T14:17:39Z DEBUG rustc_ap_rustc_parse::parser::attr] parse_outer_attributes: self.token=Token { kind: Ident("if", false), span: Span { lo: BytePos(67), hi: BytePos(69), ctxt: #0 } }
[2020-09-29T14:17:39Z DEBUG rustc_ap_rustc_parse::parser::attr] parse_outer_attributes: self.token=Token { kind: Ident("if", false), span: Span { lo: BytePos(67), hi: BytePos(69), ctxt: #0 } }
[2020-09-29T14:17:39Z DEBUG rustc_ap_rustc_parse::parser::attr] parse_outer_attributes: self.token=Token { kind: Ident("if", false), span: Span { lo: BytePos(67), hi: BytePos(69), ctxt: #0 } }