Skip to content

Commit e4836fb

Browse files
authored
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
2 parents 04a7c2c + 37260e1 commit e4836fb

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

compiler/rustc_macros/src/query.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ impl Parse for Query {
5151
let key = Pat::parse_single(&arg_content)?;
5252
arg_content.parse::<Token![:]>()?;
5353
let arg = arg_content.parse()?;
54+
let _ = arg_content.parse::<Option<Token![,]>>()?;
5455
let result = input.parse()?;
5556

5657
// Parse the query modifiers

0 commit comments

Comments
 (0)