diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-02-14 20:12:05 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-02-15 14:46:08 +1100 |
| commit | 25ed6e43b0ea03ca48692741624f3e70d717ea43 (patch) | |
| tree | 7c4dc20f60c6c62d239cd710400998f405ab1bd8 /compiler/rustc_parse/src/parser/mod.rs | |
| parent | 332c57723a03e97497d6fba6636e31c2e41fefe9 (diff) | |
| download | rust-25ed6e43b0ea03ca48692741624f3e70d717ea43.tar.gz rust-25ed6e43b0ea03ca48692741624f3e70d717ea43.zip | |
Add `ErrorGuaranteed` to `ast::LitKind::Err`, `token::LitKind::Err`.
This mostly works well, and eliminates a couple of delayed bugs. One annoying thing is that we should really also add an `ErrorGuaranteed` to `proc_macro::bridge::LitKind::Err`. But that's difficult because `proc_macro` doesn't have access to `ErrorGuaranteed`, so we have to fake it.
Diffstat (limited to 'compiler/rustc_parse/src/parser/mod.rs')
| -rw-r--r-- | compiler/rustc_parse/src/parser/mod.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_parse/src/parser/mod.rs b/compiler/rustc_parse/src/parser/mod.rs index 623407eb380..dea2b9e6ca7 100644 --- a/compiler/rustc_parse/src/parser/mod.rs +++ b/compiler/rustc_parse/src/parser/mod.rs @@ -1459,7 +1459,7 @@ impl<'a> Parser<'a> { match self.parse_str_lit() { Ok(str_lit) => Some(str_lit), Err(Some(lit)) => match lit.kind { - ast::LitKind::Err => None, + ast::LitKind::Err(_) => None, _ => { self.dcx().emit_err(NonStringAbiLiteral { span: lit.span }); None |
