File tree 2 files changed +10
-2
lines changed
2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change 26
26
#![ feature( rustc_diagnostic_macros) ]
27
27
#![ feature( slice_sort_by_cached_key) ]
28
28
#![ feature( str_escape) ]
29
+ #![ feature( try_trait) ]
29
30
#![ feature( unicode_internals) ]
30
- #![ feature( catch_expr) ]
31
31
32
32
#![ recursion_limit="256" ]
33
33
Original file line number Diff line number Diff line change @@ -1756,9 +1756,17 @@ impl<'a> Parser<'a> {
1756
1756
1757
1757
let parser_snapshot_before_pat = self . clone ( ) ;
1758
1758
1759
+ // Once we can use edition 2018 in the compiler,
1760
+ // replace this with real try blocks.
1761
+ macro_rules! try_block {
1762
+ ( $( $inside: tt) * ) => (
1763
+ ( ||{ :: std:: ops:: Try :: from_ok( { $( $inside) * } ) } ) ( )
1764
+ )
1765
+ }
1766
+
1759
1767
// We're going to try parsing the argument as a pattern (even though it's not
1760
1768
// allowed). This way we can provide better errors to the user.
1761
- let pat_arg: PResult < ' a , _ > = do catch {
1769
+ let pat_arg: PResult < ' a , _ > = try_block ! {
1762
1770
let pat = self . parse_pat( ) ?;
1763
1771
self . expect( & token:: Colon ) ?;
1764
1772
( pat, self . parse_ty( ) ?)
You can’t perform that action at this time.
0 commit comments