summary refs log tree commit diff
path: root/src/libsyntax_ext
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2017-12-13 23:05:49 -0800
committerEsteban Küber <esteban@kuber.com.ar>2017-12-21 14:57:42 -0800
commitaaf3e318fc33edcc6dbf0920998c3f27d00dd818 (patch)
treea9dadd8df5519666c6293b0f2b3b59f67ef32f6b /src/libsyntax_ext
parentb7b52cc8bf2bcc4cbd223a4b61fe3e35e798f6e2 (diff)
downloadrust-aaf3e318fc33edcc6dbf0920998c3f27d00dd818.tar.gz
rust-aaf3e318fc33edcc6dbf0920998c3f27d00dd818.zip
Do not emit type errors on recovered blocks
When a parse error occurs on a block, the parser will recover and create
a block with the statements collected until that point. Now a flag
stating that a recovery has been performed in this block is propagated
so that the type checker knows that the type of the block (which will be
identified as `()`) shouldn't be checked against the expectation to
reduce the amount of irrelevant diagnostic errors shown to the user.
Diffstat (limited to 'src/libsyntax_ext')
-rw-r--r--src/libsyntax_ext/deriving/mod.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/libsyntax_ext/deriving/mod.rs b/src/libsyntax_ext/deriving/mod.rs
index a6696b53369..a3246a21d5a 100644
--- a/src/libsyntax_ext/deriving/mod.rs
+++ b/src/libsyntax_ext/deriving/mod.rs
@@ -158,5 +158,6 @@ fn call_intrinsic(cx: &ExtCtxt,
         id: ast::DUMMY_NODE_ID,
         rules: ast::BlockCheckMode::Unsafe(ast::CompilerGenerated),
         span,
+        recovered: false,
     }))
 }