+ /// Recover on the syntax `do catch { ... }` suggesting `try { ... }` instead.
+ fn recover_do_catch(&mut self, attrs: ThinVec<Attribute>) -> PResult<'a, P<Expr>> {
+ let lo = self.token.span;
+
+ self.bump(); // `do`
+ self.bump(); // `catch`
+
+ let span_dc = lo.to(self.prev_span);
+ self.struct_span_err(span_dc, "found removed `do catch` syntax")
+ .span_suggestion(
+ span_dc,
+ "replace with the new syntax",
+ "try".to_string(),
+ Applicability::MachineApplicable,
+ )
+ .note("following RFC #2388, the new non-placeholder syntax is `try`")
+ .emit();
+
+ self.parse_try_block(lo, attrs)
+ }
+