Closed
Description
This is an odd bug I found while running rustfmt on Criterion.rs.
Steps to reproduce:
cargo init rustfmt-test
- Create a benches directory (this doesn't happen if the code is in src)
- Create a file named
test.rs
in the benches directory with the following code:
macro_rules! bench {
($ty:ident) => {
criterion_group!(
name = benches;
config = ::common_bench::reduced_samples();
targets = call, map;
);
};
}
- Run
cargo +nightly fmt
. Code now looks like this:
macro_rules! bench {
($ty:ident) => {
criterion_group!(
name = benches;
config = ::common_bench::reduced_samples();
targets = call, map;
);
};
}
- Run
cargo +nightly fmt
again. Code now looks like this:
macro_rules! bench {
($ty:ident) => {
criterion_group!(
name = benches;
config = ::common_bench::reduced_samples();
targets = call, map;
);
};
}
It always adds another 8 spaces before those four lines. I haven't been able to find a workaround for this (though if you find one, please let me know so I can re-enable my rustfmt Travis-CI build).