@@ -13,7 +13,7 @@ use rustc_ast_pretty::pprust;
1313use rustc_errors:: DiagCtxtHandle ;
1414use rustc_hir:: { self as hir, AttrPath } ;
1515use rustc_span:: symbol:: { Ident , kw, sym} ;
16- use rustc_span:: { ErrorGuaranteed , Span , Symbol } ;
16+ use rustc_span:: { Span , Symbol } ;
1717
1818pub struct SegmentIterator < ' a > {
1919 offset : usize ,
@@ -176,7 +176,7 @@ impl<'a> ArgParser<'a> {
176176pub enum MetaItemOrLitParser < ' a > {
177177 MetaItemParser ( MetaItemParser < ' a > ) ,
178178 Lit ( MetaItemLit ) ,
179- Err ( Span , ErrorGuaranteed ) ,
179+ Err ( Span ) ,
180180}
181181
182182impl < ' a > MetaItemOrLitParser < ' a > {
@@ -186,7 +186,7 @@ impl<'a> MetaItemOrLitParser<'a> {
186186 generic_meta_item_parser. span ( )
187187 }
188188 MetaItemOrLitParser :: Lit ( meta_item_lit) => meta_item_lit. span ,
189- MetaItemOrLitParser :: Err ( span, _ ) => * span,
189+ MetaItemOrLitParser :: Err ( span) => * span,
190190 }
191191 }
192192
@@ -495,12 +495,9 @@ impl<'a> MetaItemListParserContext<'a> {
495495 // where the macro didn't expand to a literal. An error is already given
496496 // for this at this point, and then we do continue. This makes this path
497497 // reachable...
498- let e = self . dcx . span_delayed_bug (
499- * span,
500- "expr in place where literal is expected (builtin attr parsing)" ,
501- ) ;
502-
503- return Some ( MetaItemOrLitParser :: Err ( * span, e) ) ;
498+ // NOTE: For backward compatibility we can't emit any error / delayed bug here (yet).
499+ // See <https://github.com/rust-lang/rust/issues/140612>
500+ return Some ( MetaItemOrLitParser :: Err ( * span) ) ;
504501 } else {
505502 self . next_path ( ) ?
506503 } ;
0 commit comments