Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 49ca89d

Browse files
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‎

Lines changed: 1 addition & 0 deletions
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‎

Lines changed: 2 additions & 3 deletions
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)

AltStyle によって変換されたページ (->オリジナル) /