Closed BillyDM closed 1 year ago
maybe we need to put the attribute that tells cargo fmt to leave it alone on there
I tried adding this attribute:
#[rustfmt::skip::macros(simd_runtime_generate)]
And it does work. However, it seems that since the trailing comma is legal Rust syntax as shown in the example above, can the macro be fixed to allow for this case? It would be much nicer to have it work well with the formatter.
I'll ask the Rust Community Discord to see if someone who is an expert on macros can help.
I also found this that may be useful. https://danielkeep.github.io/tlborm/book/pat-trailing-separators.html
The recent pull request fixed the issue for me. When can I expect the crates.io version to be updated with the fix?
I checked the commit logs and it seems that this PR fixed the trailing problem on 2020-08-29, just as @BillyDM mentioned on 2020-08-30.
I suggest that we close this issue.
Running
cargo fmt
in a project will sometimes break thesimd_compiletime_generate!
andsimd_runtime_generate!
macros. When it does, rust says it cannot find any of the functions generated with the macro. For example,cargo fmt
will break up long functions line by line for readability like this:becomes
I found if I remove the comma after
end_amp: f32,
then it works again. However, runningcargo fmt
again adds the comma back.