File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed
compiler/rustc_expand/src/mbe Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change 7272
7373pub ( crate ) use NamedMatch :: * ;
7474pub ( crate ) use ParseResult :: * ;
75+ use rustc_errors:: ErrorGuaranteed ;
7576
7677use crate :: mbe:: { KleeneOp , TokenTree } ;
7778
@@ -270,7 +271,7 @@ pub(crate) enum ParseResult<T> {
270271 Failure ( Token , & ' static str ) ,
271272 /// Fatal error (malformed macro?). Abort compilation.
272273 Error ( rustc_span:: Span , String ) ,
273- ErrorReported ,
274+ ErrorReported ( ErrorGuaranteed ) ,
274275}
275276
276277/// A `ParseResult` where the `Success` variant contains a mapping of
@@ -612,14 +613,14 @@ impl TtParser {
612613 // edition-specific matching behavior for non-terminals.
613614 let nt = match parser. to_mut ( ) . parse_nonterminal ( kind) {
614615 Err ( mut err) => {
615- err. span_label (
616+ let guarantee = err. span_label (
616617 span,
617618 format ! (
618619 "while parsing argument for this `{kind}` macro fragment"
619620 ) ,
620621 )
621622 . emit ( ) ;
622- return ErrorReported ;
623+ return ErrorReported ( guarantee ) ;
623624 }
624625 Ok ( nt) => nt,
625626 } ;
Original file line number Diff line number Diff line change @@ -333,7 +333,7 @@ fn expand_macro<'cx>(
333333 cx. struct_span_err ( span, & msg) . emit ( ) ;
334334 return DummyResult :: any ( span) ;
335335 }
336- ErrorReported => return DummyResult :: any ( sp) ,
336+ ErrorReported ( _ ) => return DummyResult :: any ( sp) ,
337337 }
338338
339339 // The matcher was not `Success(..)`ful.
@@ -470,7 +470,7 @@ pub fn compile_declarative_macro(
470470 . emit ( ) ;
471471 return dummy_syn_ext ( ) ;
472472 }
473- ErrorReported => {
473+ ErrorReported ( _ ) => {
474474 return dummy_syn_ext ( ) ;
475475 }
476476 } ;
You can’t perform that action at this time.
0 commit comments