diff options
| author | Deadbeef <ent3rm4n@gmail.com> | 2023-03-27 13:44:06 +0000 |
|---|---|---|
| committer | Deadbeef <ent3rm4n@gmail.com> | 2023-04-06 04:55:58 +0000 |
| commit | af74ef89934ad30b24132b464b6b4cf7cb0e1381 (patch) | |
| tree | 60eaf705873a5d7a894449f56b090bddc751c693 /compiler/rustc_macros/src/query.rs | |
| parent | 33289132ecc1805250f63801fded10fceb2300d8 (diff) | |
| download | rust-af74ef89934ad30b24132b464b6b4cf7cb0e1381.tar.gz rust-af74ef89934ad30b24132b464b6b4cf7cb0e1381.zip | |
migrate rustc_macros to syn 2.0
Diffstat (limited to 'compiler/rustc_macros/src/query.rs')
| -rw-r--r-- | compiler/rustc_macros/src/query.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_macros/src/query.rs b/compiler/rustc_macros/src/query.rs index 08e42a8a08f..f85ba38003c 100644 --- a/compiler/rustc_macros/src/query.rs +++ b/compiler/rustc_macros/src/query.rs @@ -15,7 +15,7 @@ mod kw { /// Ensures only doc comment attributes are used fn check_attributes(attrs: Vec<Attribute>) -> Result<Vec<Attribute>> { let inner = |attr: Attribute| { - if !attr.path.is_ident("doc") { + if !attr.path().is_ident("doc") { Err(Error::new(attr.span(), "attributes not supported on queries")) } else if attr.style != AttrStyle::Outer { Err(Error::new( @@ -48,7 +48,7 @@ impl Parse for Query { let name: Ident = input.parse()?; let arg_content; parenthesized!(arg_content in input); - let key = arg_content.parse()?; + let key = Pat::parse_single(&arg_content)?; arg_content.parse::<Token![:]>()?; let arg = arg_content.parse()?; let result = input.parse()?; @@ -158,7 +158,7 @@ fn parse_query_modifiers(input: ParseStream<'_>) -> Result<QueryModifiers> { } else { None }; - let list = attr_content.parse_terminated(Expr::parse)?; + let list = attr_content.parse_terminated(Expr::parse, Token![,])?; try_insert!(desc = (tcx, list)); } else if modifier == "cache_on_disk_if" { // Parse a cache modifier like: @@ -166,7 +166,7 @@ fn parse_query_modifiers(input: ParseStream<'_>) -> Result<QueryModifiers> { let args = if input.peek(token::Paren) { let args; parenthesized!(args in input); - let tcx = args.parse()?; + let tcx = Pat::parse_single(&args)?; Some(tcx) } else { None |
