about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <476013+matthiaskrgr@users.noreply.github.com>2025-05-21 11:28:46 +0200
committerGitHub <noreply@github.com>2025-05-21 11:28:46 +0200
commite4836fbb89db9a93a2f347f1f34a5a60e7f8a4af (patch)
tree2633287f4f4653497be4464761e0e0ab3b68777e
parent04a7c2c66def495a4e386c63a2ea5cd9bb670280 (diff)
parent37260e1c5b920baf12ec0dd6755751d1783e27ed (diff)
downloadrust-e4836fbb89db9a93a2f347f1f34a5a60e7f8a4af.tar.gz
rust-e4836fbb89db9a93a2f347f1f34a5a60e7f8a4af.zip
Rollup merge of #141284 - compiler-errors:query-nit, r=oli-obk
Allow trailing comma after argument in query definition

Don't catastrophically fail the query macro if you put a comma after your query key!

r? oli-obk
-rw-r--r--compiler/rustc_macros/src/query.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/rustc_macros/src/query.rs b/compiler/rustc_macros/src/query.rs
index ee377277017..2196f71299a 100644
--- a/compiler/rustc_macros/src/query.rs
+++ b/compiler/rustc_macros/src/query.rs
@@ -51,6 +51,7 @@ impl Parse for Query {
         let key = Pat::parse_single(&arg_content)?;
         arg_content.parse::<Token![:]>()?;
         let arg = arg_content.parse()?;
+        let _ = arg_content.parse::<Option<Token![,]>>()?;
         let result = input.parse()?;
 
         // Parse the query modifiers