Closed
Description
fn main() {
match true {
true => 'a: {
break 'a
}
_ => (),
}
}
formats into:
fn main() {
match true {
true => break 'a,
_ => (),
}
}
So the label is no longer valid.
In this simple case, you could just prevent the formatting by adding a semicolon after the break, but a more complex case might not return ()
from the labelled block (and therefore require additional changes).
Version:
rustfmt 1.5.2-nightly (c18a5e8a 2023-01-25)
EDIT (@ytmimi): Updated the examples so that rustfmt can be run on the code snippet directly.
Metadata
Metadata
Assignees
Labels
No labels