Skip to content

Commit 7ca6ae7

Browse files
committed
suppress internal error
1 parent 9124dd8 commit 7ca6ae7

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

rustfmt-core/rustfmt-lib/src/visitor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ impl<'b, 'a: 'b> FmtVisitor<'a> {
364364
mk_sp(s.lo(), b.span.lo()),
365365
)
366366
}
367-
_ => unreachable!(),
367+
_ => return,
368368
};
369369

370370
if let Some((fn_str, fn_brace_style)) = rewrite {
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// following code is invalid but should not cause an internal error
2+
fn main() {
3+
extern "C" fn packet_records_options_impl_layout_length_encoding_option_len_multiplier();
4+
}

0 commit comments

Comments
 (0)