Closed YaLTeR closed 3 years ago
rustfmt v1.4.11 was actually not formatting those macro defs whatsoever because it was failing to do so, so it was just leaving your original snippet in place. To see that a bit more obviously, you can try using this heavily misformatted representation of the provided macro and you'll see rustfmt v1.4.11 leaves it as-is.
macro_rules!
prop_get_something
{
($name:ident, $func:ident, $rv:ty) => (
#[inline]
pub(crate) unsafe fn $name(
self,
map: &ffi::VSMap,
key: *const c_char,
index: i32,
error: &mut i32,
) -> $rv {
(self.handle.as_ref().$func)(map, key, index, error)
}
)
}
The reason why you see the formatting change with v1.4.12 is because that's the first version of rustfmt that is able to successfully apply the formatting rules. There were a ton of upstream rustc changes and rustfmt improvements incorporated between 1.4.11 and 1.4.12, and one or more of those resolved an existing problem that existed in rustfmt v1.4.11 and earlier versions.
Closing this accordingly
Ah, I see, thanks.
Describe the bug
Noticed today when I got a PR to vapoursynth-rs and the CI broke.
The code: https://github.com/YaLTeR/vapoursynth-rs/blob/f05e4a3e10ccc4d9a21b27203e3fe5a4a907c2a9/vapoursynth/src/api.rs#L37-L65
Expected behavior
No change as this is still rustfmt 1, it fits within line length, it compiles, and no unstable options were used.
Meta
1.4.11-stable (9eb4b56 2020-01-29)
, in 1.43.0 it's1.4.12-stable (a828ffe 2020-03-11)