diff options
| author | bors <bors@rust-lang.org> | 2025-05-09 20:37:37 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2025-05-09 20:37:37 +0000 |
| commit | 17067e9ac6d7ecb70e50f92c1944e545188d2359 (patch) | |
| tree | 10cdfd82bfa6bb95d7e99b7ab53d8121fc7a8913 /compiler/rustc_attr_parsing/src/parser.rs | |
| parent | af91af44eb85ceac634afa72cc73be4af358b350 (diff) | |
| parent | 908c30b3e1b758d46501de460163e9761c65534f (diff) | |
| download | rust-1.87.0.tar.gz rust-1.87.0.zip | |
Auto merge of #140859 - pietroalbini:pa-stable, r=pietroalbini 1.87.0
[stable] Prepare the 1.87.0 release Preparing the stable artifacts as described in the release process. This PR also includes the following last minute backports: * https://github.com/rust-lang/rust/pull/140810 * https://github.com/rust-lang/rust/pull/140601 * https://github.com/rust-lang/rust/pull/140684 r? `@ghost`
Diffstat (limited to 'compiler/rustc_attr_parsing/src/parser.rs')
| -rw-r--r-- | compiler/rustc_attr_parsing/src/parser.rs | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/compiler/rustc_attr_parsing/src/parser.rs b/compiler/rustc_attr_parsing/src/parser.rs index a8a1460591c..e84bac945dc 100644 --- a/compiler/rustc_attr_parsing/src/parser.rs +++ b/compiler/rustc_attr_parsing/src/parser.rs @@ -13,7 +13,7 @@ use rustc_ast_pretty::pprust; use rustc_errors::DiagCtxtHandle; use rustc_hir::{self as hir, AttrPath}; use rustc_span::symbol::{Ident, kw, sym}; -use rustc_span::{ErrorGuaranteed, Span, Symbol}; +use rustc_span::{Span, Symbol}; pub struct SegmentIterator<'a> { offset: usize, @@ -176,7 +176,7 @@ impl<'a> ArgParser<'a> { pub enum MetaItemOrLitParser<'a> { MetaItemParser(MetaItemParser<'a>), Lit(MetaItemLit), - Err(Span, ErrorGuaranteed), + Err(Span), } impl<'a> MetaItemOrLitParser<'a> { @@ -186,7 +186,7 @@ impl<'a> MetaItemOrLitParser<'a> { generic_meta_item_parser.span() } MetaItemOrLitParser::Lit(meta_item_lit) => meta_item_lit.span, - MetaItemOrLitParser::Err(span, _) => *span, + MetaItemOrLitParser::Err(span) => *span, } } @@ -495,12 +495,9 @@ impl<'a> MetaItemListParserContext<'a> { // where the macro didn't expand to a literal. An error is already given // for this at this point, and then we do continue. This makes this path // reachable... - let e = self.dcx.span_delayed_bug( - *span, - "expr in place where literal is expected (builtin attr parsing)", - ); - - return Some(MetaItemOrLitParser::Err(*span, e)); + // NOTE: For backward compatibility we can't emit any error / delayed bug here (yet). + // See <https://github.com/rust-lang/rust/issues/140612> + return Some(MetaItemOrLitParser::Err(*span)); } else { self.next_path()? }; |
