From aaf3e318fc33edcc6dbf0920998c3f27d00dd818 Mon Sep 17 00:00:00 2001 From: Esteban Küber Date: Wed, 13 Dec 2017 23:05:49 -0800 Subject: 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. --- src/libsyntax_ext/deriving/mod.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'src/libsyntax_ext') 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, })) } -- cgit 1.4.1-3-g733a5