-
Notifications
You must be signed in to change notification settings - Fork 897
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix build with rust nightly by updating try block syntax. (#2965)
- Loading branch information
1 parent
10512a5
commit ca19c9a
Showing
6 changed files
with
71 additions
and
69 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,28 @@ | ||
#![feature(catch_expr)] | ||
// rustfmt-edition: Edition2018 | ||
#![feature(try_blocks)] | ||
|
||
fn main() { | ||
let x = do catch { | ||
let x = try { | ||
foo()? | ||
}; | ||
|
||
let x = do catch /* Invisible comment */ { foo()? }; | ||
let x = try /* Invisible comment */ { foo()? }; | ||
|
||
let x = do catch { | ||
let x = try { | ||
unsafe { foo()? } | ||
}; | ||
|
||
let y = match (do catch { | ||
let y = match (try { | ||
foo()? | ||
}) { | ||
_ => (), | ||
}; | ||
|
||
do catch { | ||
try { | ||
foo()?; | ||
}; | ||
|
||
do catch { | ||
// Regular do catch block | ||
try { | ||
// Regular try block | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,22 @@ | ||
#![feature(catch_expr)] | ||
// rustfmt-edition: Edition2018 | ||
#![feature(try_blocks)] | ||
|
||
fn main() { | ||
let x = do catch { foo()? }; | ||
let x = try { foo()? }; | ||
|
||
let x = do catch /* Invisible comment */ { foo()? }; | ||
let x = try /* Invisible comment */ { foo()? }; | ||
|
||
let x = do catch { unsafe { foo()? } }; | ||
let x = try { unsafe { foo()? } }; | ||
|
||
let y = match (do catch { foo()? }) { | ||
let y = match (try { foo()? }) { | ||
_ => (), | ||
}; | ||
|
||
do catch { | ||
try { | ||
foo()?; | ||
}; | ||
|
||
do catch { | ||
// Regular do catch block | ||
try { | ||
// Regular try block | ||
}; | ||
} |