about summary refs log tree commit diff
path: root/compiler/rustc_expand/src/mbe/macro_parser.rs
diff options
context:
space:
mode:
authorNilstrieb <48135649+Nilstrieb@users.noreply.github.com>2022-10-27 21:39:57 +0200
committerNilstrieb <48135649+Nilstrieb@users.noreply.github.com>2022-11-02 21:05:09 +0100
commit8d13b2a046d35e657c7e497cfeda6b2165dc931f (patch)
treeff96285c09be87581d6beaf321e8f71798467107 /compiler/rustc_expand/src/mbe/macro_parser.rs
parentc0a76127283bc963b085f54a1b275a8e281e81e6 (diff)
downloadrust-8d13b2a046d35e657c7e497cfeda6b2165dc931f.tar.gz
rust-8d13b2a046d35e657c7e497cfeda6b2165dc931f.zip
Store `ErrorGuaranteed` in `ErrorReported`
Diffstat (limited to 'compiler/rustc_expand/src/mbe/macro_parser.rs')
-rw-r--r--compiler/rustc_expand/src/mbe/macro_parser.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/compiler/rustc_expand/src/mbe/macro_parser.rs b/compiler/rustc_expand/src/mbe/macro_parser.rs
index c8bdc39311c..aa7a06f66d7 100644
--- a/compiler/rustc_expand/src/mbe/macro_parser.rs
+++ b/compiler/rustc_expand/src/mbe/macro_parser.rs
@@ -72,6 +72,7 @@
 
 pub(crate) use NamedMatch::*;
 pub(crate) use ParseResult::*;
+use rustc_errors::ErrorGuaranteed;
 
 use crate::mbe::{KleeneOp, TokenTree};
 
@@ -270,7 +271,7 @@ pub(crate) enum ParseResult<T> {
     Failure(Token, &'static str),
     /// Fatal error (malformed macro?). Abort compilation.
     Error(rustc_span::Span, String),
-    ErrorReported,
+    ErrorReported(ErrorGuaranteed),
 }
 
 /// A `ParseResult` where the `Success` variant contains a mapping of
@@ -612,14 +613,14 @@ impl TtParser {
                         // edition-specific matching behavior for non-terminals.
                         let nt = match parser.to_mut().parse_nonterminal(kind) {
                             Err(mut err) => {
-                                err.span_label(
+                                let guarantee = err.span_label(
                                     span,
                                     format!(
                                         "while parsing argument for this `{kind}` macro fragment"
                                     ),
                                 )
                                 .emit();
-                                return ErrorReported;
+                                return ErrorReported(guarantee);
                             }
                             Ok(nt) => nt,
                         };