diff options
| author | Michael Goulet <michael@errs.io> | 2023-06-23 19:18:18 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2023-06-23 19:18:20 +0000 |
| commit | 2cc7782cfd85a2c4dc2fa566fae4d4e356976471 (patch) | |
| tree | ff4b7e9b097aed21ee8bdc70bf425821b2bb5c05 /compiler/rustc_parse/src/parser/expr.rs | |
| parent | 04075b32021932e3e8f6ab55d519b3b3494b6ef9 (diff) | |
| download | rust-2cc7782cfd85a2c4dc2fa566fae4d4e356976471.tar.gz rust-2cc7782cfd85a2c4dc2fa566fae4d4e356976471.zip | |
Add suggestion for bad block fragment error
Diffstat (limited to 'compiler/rustc_parse/src/parser/expr.rs')
| -rw-r--r-- | compiler/rustc_parse/src/parser/expr.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/rustc_parse/src/parser/expr.rs b/compiler/rustc_parse/src/parser/expr.rs index 88c6cc1ae70..1b3d4e301a9 100644 --- a/compiler/rustc_parse/src/parser/expr.rs +++ b/compiler/rustc_parse/src/parser/expr.rs @@ -2186,6 +2186,10 @@ impl<'a> Parser<'a> { self.sess.emit_err(errors::InvalidBlockMacroSegment { span: self.token.span, context: lo.to(self.token.span), + wrap: errors::WrapInExplicitBlock { + lo: self.token.span.shrink_to_lo(), + hi: self.token.span.shrink_to_hi(), + }, }); } |
