Skip to content

Commit ed53077

Browse files
committed
improve tests
1 parent b883eeb commit ed53077

4 files changed

Lines changed: 12 additions & 0 deletions

File tree

tests/source/try_block.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// rustfmt-edition: 2018
2+
#![feature(try_blocks)]
23

34
fn main() -> Result<(), !> {
45
let _x: Option<_> = try {

tests/source/try_blocks_heterogeneous.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// rustfmt-edition: 2018
2+
#![feature(try_blocks_heterogeneous)]
23

34
fn main() -> Result<(), !> {
45
let _x = try bikeshed Option<_> {
@@ -24,6 +25,10 @@ fn baz() -> Option<i32> {
2425
6
2526
}; // comment
2627

28+
let x = try /* Invisible comment */ bikeshed Option<()> {};
29+
let x = try bikeshed /* Invisible comment */ Option<()> {};
30+
let x = try bikeshed Option<()> /* Invisible comment */ {};
31+
2732
let x = try bikeshed Option<i32> { baz()?; baz()?; baz()?; 7 };
2833

2934
let x = try bikeshed Foo<Bar, Bar, Bar, Bar, Bar, Bar, Bar, Bar, Bar, Bar, Bar, Bar, Bar> { 1 + 1 + 1 };

tests/target/try_block.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// rustfmt-edition: 2018
2+
#![feature(try_blocks)]
23

34
fn main() -> Result<(), !> {
45
let _x: Option<_> = try { 4 };

tests/target/try_blocks_heterogeneous.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// rustfmt-edition: 2018
2+
#![feature(try_blocks_heterogeneous)]
23

34
fn main() -> Result<(), !> {
45
let _x = try bikeshed Option<_> { 4 };
@@ -18,6 +19,10 @@ fn baz() -> Option<i32> {
1819

1920
let y = try bikeshed Option<i32> { 6 }; // comment
2021

22+
let x = try /* Invisible comment */ bikeshed Option<()> {};
23+
let x = try bikeshed /* Invisible comment */ Option<()> {};
24+
let x = try bikeshed Option<()> /* Invisible comment */ {};
25+
2126
let x = try bikeshed Option<i32> {
2227
baz()?;
2328
baz()?;

0 commit comments

Comments
 (0)