Rustfmt would remove 'block: inside rustfnmt_test0, which will break break 'block Ok(0) line.
For reference, rustfnmt_test1 code won't be broken. this issue only happens with rust.
macro_rules! test_macro {
(|$transaction: ident| $body: expr) => {{
let $transaction = some_value;
let _ = $body;
}};
}
pub async fn rustfnmt_test0(condition: &bool) {
test_macro!(|transaction| 'block: {
if condition {
break 'block Ok(0);
}
todo!()
});
}
pub async fn rustfnmt_test1(condition: &bool) {
let x = |transaction| 'block: {
if condition {
break 'block Ok(0);
}
todo!()
};
}
rustfmt 1.8.0-beta (0277061b9a 2025-02-01)