File tree 2 files changed +6
-5
lines changed
compiler/rustc_expand/src/mbe
2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change 72
72
73
73
pub ( crate ) use NamedMatch :: * ;
74
74
pub ( crate ) use ParseResult :: * ;
75
+ use rustc_errors:: ErrorGuaranteed ;
75
76
76
77
use crate :: mbe:: { KleeneOp , TokenTree } ;
77
78
@@ -270,7 +271,7 @@ pub(crate) enum ParseResult<T> {
270
271
Failure ( Token , & ' static str ) ,
271
272
/// Fatal error (malformed macro?). Abort compilation.
272
273
Error ( rustc_span:: Span , String ) ,
273
- ErrorReported ,
274
+ ErrorReported ( ErrorGuaranteed ) ,
274
275
}
275
276
276
277
/// A `ParseResult` where the `Success` variant contains a mapping of
@@ -612,14 +613,14 @@ impl TtParser {
612
613
// edition-specific matching behavior for non-terminals.
613
614
let nt = match parser. to_mut ( ) . parse_nonterminal ( kind) {
614
615
Err ( mut err) => {
615
- err. span_label (
616
+ let guarantee = err. span_label (
616
617
span,
617
618
format ! (
618
619
"while parsing argument for this `{kind}` macro fragment"
619
620
) ,
620
621
)
621
622
. emit ( ) ;
622
- return ErrorReported ;
623
+ return ErrorReported ( guarantee ) ;
623
624
}
624
625
Ok ( nt) => nt,
625
626
} ;
Original file line number Diff line number Diff line change @@ -333,7 +333,7 @@ fn expand_macro<'cx>(
333
333
cx. struct_span_err ( span, & msg) . emit ( ) ;
334
334
return DummyResult :: any ( span) ;
335
335
}
336
- ErrorReported => return DummyResult :: any ( sp) ,
336
+ ErrorReported ( _ ) => return DummyResult :: any ( sp) ,
337
337
}
338
338
339
339
// The matcher was not `Success(..)`ful.
@@ -470,7 +470,7 @@ pub fn compile_declarative_macro(
470
470
. emit ( ) ;
471
471
return dummy_syn_ext ( ) ;
472
472
}
473
- ErrorReported => {
473
+ ErrorReported ( _ ) => {
474
474
return dummy_syn_ext ( ) ;
475
475
}
476
476
} ;
You can’t perform that action at this time.
0 commit comments