David Bar-On

Results 163 comments of David Bar-On

> ... address the second indentation issue that occurs when rustfmt is unable to format the macro (indentation idempotence issue is resolved, but rustfmt would still be unable to format...

The root cause of the problem is here: https://github.com/rust-lang/rustfmt/blob/ea017d7f84e218c4a8048d2ecd9d63bbda014209/src/attr.rs#L348 `self.meta()` returns `None`, because an Attribute key's value is expected to be a Literal, but the `$a` value of `default_value` is...

> It seems that to resolve the issue `ast::Attributes::tokens()` may need to be used when `ast::Attributes::meta()` fails. On a second though, a better solution is that [`rustc_ast::ast::Attribute::meta`](https://github.com/rust-lang/rust/blob/36e530cb08950f1d03ab733e43ecec2802d099cf/compiler/rustc_ast/src/attr/mod.rs#L284-L289) will support `Indent`,...

Submitted PR #5518 with a suggested fix, although a better approach for the fix is probably enhancing `Attribute::meta()`.

> I was curious why the Cargo.lock needed to change. I don't know. This is beyond my understanding of caro ... It seems that at least the first `cargo make`...

> ... `cargo build` has worked just fine for me. Switched to `cargo build` and it works fine also for me. Thanks. > Ultimately I think our goal for macro...

> ... `cargo build` has worked just fine for me. Switched to `cargo build` and it works fine also for me. Thanks. > Ultimately I think our goal for macro...

> #[cfg(all(feature1 = "std1",feature2 = "std2",),),] This is a good example! I found that my initial fix was wrong, and did not properly handle the commas between the parenthesis ......

> ... #3228, which this PR solves. If you don't mind could you add a test case for the `#![allow(nline_always,)]` case mentioned in that issue. Added `tests/target/issue-3228` folder with this...

Sorry, my mistake. Somehow I wrongly formatted the input example in GitHub. No special option is set. A right input with tab size 4 is: ```rust fn main() { /*...