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
This commit is contained in:
Matthias Krüger 2025-05-21 11:28:46 +02:00 committed by GitHub
commit e4836fbb89
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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