diff options
Diffstat (limited to 'src/tools/rustfmt/tests/target/catch.rs')
-rw-r--r-- | src/tools/rustfmt/tests/target/catch.rs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/tools/rustfmt/tests/target/catch.rs b/src/tools/rustfmt/tests/target/catch.rs new file mode 100644 index 000000000..ffe694f8e --- /dev/null +++ b/src/tools/rustfmt/tests/target/catch.rs @@ -0,0 +1,22 @@ +// rustfmt-edition: 2018 +#![feature(try_blocks)] + +fn main() { + let x = try { foo()? }; + + let x = try /* Invisible comment */ { foo()? }; + + let x = try { unsafe { foo()? } }; + + let y = match (try { foo()? }) { + _ => (), + }; + + try { + foo()?; + }; + + try { + // Regular try block + }; +} |