Skip to content

Commit 49ca89d

Browse files
committed
Fix pretty printing of never pattern match arms.
1 parent 9f49700 commit 49ca89d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

compiler/rustc_ast_pretty/src/pprust/state/expr.rs

+1
Original file line numberDiff line numberDiff line change
@@ -876,6 +876,7 @@ impl<'a> State<'a> {
876876
}
877877
}
878878
} else {
879+
self.end(); // Close the ibox for the pattern.
879880
self.word(",");
880881
}
881882
self.end(); // Close enclosing cbox.

tests/pretty/never-pattern.pp

+2-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#[macro_use]
1313
extern crate std;
1414

15-
fn f(x: Result<u32, !>) {
16-
_ = match x { Ok(x) => x, Err(!) , }; }
15+
fn f(x: Result<u32, !>) { _ = match x { Ok(x) => x, Err(!) , }; }
1716

18-
fn main() {}
17+
fn main() {}

0 commit comments

Comments
 (0)