about summary refs log tree commit diff
path: root/src/libsyntax_pos
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-04-12 05:38:49 +0000
committerbors <bors@rust-lang.org>2018-04-12 05:38:49 +0000
commit252a459d373f40512ed9137d59e4b6bea5d6aaee (patch)
tree2148fc7dbd4b8564861b4c8df9e1e097b32d35dc /src/libsyntax_pos
parent47778811d9752d9db0d1d4621bbc225317ad216b (diff)
parent311ff5b441c25c545c3b7928bb9f947b8e47be6f (diff)
downloadrust-252a459d373f40512ed9137d59e4b6bea5d6aaee.tar.gz
rust-252a459d373f40512ed9137d59e4b6bea5d6aaee.zip
Auto merge of #49371 - scottmcm:catch-wrapping, r=nikomatsakis
Add ok-wrapping to catch blocks, per RFC

Updates the `catch{}` lowering to wrap the result in `Try::from_ok`.

r? @nikomatsakis

Fixes #41414
Fixes #43818
Diffstat (limited to 'src/libsyntax_pos')
-rw-r--r--src/libsyntax_pos/hygiene.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libsyntax_pos/hygiene.rs b/src/libsyntax_pos/hygiene.rs
index c180563450f..8cb5776fdeb 100644
--- a/src/libsyntax_pos/hygiene.rs
+++ b/src/libsyntax_pos/hygiene.rs
@@ -432,6 +432,7 @@ pub enum ExpnFormat {
 pub enum CompilerDesugaringKind {
     DotFill,
     QuestionMark,
+    Catch,
 }
 
 impl CompilerDesugaringKind {
@@ -440,6 +441,7 @@ impl CompilerDesugaringKind {
         let s = match *self {
             DotFill => "...",
             QuestionMark => "?",
+            Catch => "do catch",
         };
         Symbol::intern(s)
     }