]> git.lizzy.rs Git - rust.git/blob - tests/source/catch.rs
Prevent duplicate comma when formatting struct pattern with ".."
[rust.git] / tests / source / catch.rs
1 // rustfmt-edition: 2018
2 #![feature(try_blocks)]
3
4 fn main() {
5     let x = try {
6         foo()?
7     };
8
9     let x = try /* Invisible comment */ { foo()? };
10
11     let x = try {
12         unsafe { foo()? }
13     };
14
15     let y = match (try {
16         foo()?
17     }) {
18         _ => (),
19     };
20
21     try {
22         foo()?;
23     };
24
25     try {
26         // Regular try block
27     };
28 }