From 1376c5a617be5c25655d0d7cb63e3beaa5a6e026 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:20:39 +0200 Subject: Merging upstream version 1.70.0+dfsg1. Signed-off-by: Daniel Baumann --- vendor/syn/src/group.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'vendor/syn/src/group.rs') diff --git a/vendor/syn/src/group.rs b/vendor/syn/src/group.rs index 7fd273c1d..cccbc467d 100644 --- a/vendor/syn/src/group.rs +++ b/vendor/syn/src/group.rs @@ -1,7 +1,8 @@ use crate::error::Result; use crate::parse::ParseBuffer; use crate::token; -use proc_macro2::{Delimiter, Span}; +use proc_macro2::extra::DelimSpan; +use proc_macro2::Delimiter; // Not public API. #[doc(hidden)] @@ -62,7 +63,7 @@ pub fn parse_brackets<'a>(input: &ParseBuffer<'a>) -> Result> { #[cfg(any(feature = "full", feature = "derive"))] pub(crate) fn parse_group<'a>(input: &ParseBuffer<'a>) -> Result> { parse_delimited(input, Delimiter::None).map(|(span, content)| Group { - token: token::Group(span), + token: token::Group(span.join()), content, }) } @@ -70,7 +71,7 @@ pub(crate) fn parse_group<'a>(input: &ParseBuffer<'a>) -> Result> { fn parse_delimited<'a>( input: &ParseBuffer<'a>, delimiter: Delimiter, -) -> Result<(Span, ParseBuffer<'a>)> { +) -> Result<(DelimSpan, ParseBuffer<'a>)> { input.step(|cursor| { if let Some((content, span, rest)) = cursor.group(delimiter) { let scope = crate::buffer::close_span_of_group(*cursor); @@ -119,7 +120,7 @@ fn parse_delimited<'a>( /// struct_token: input.parse()?, /// ident: input.parse()?, /// paren_token: parenthesized!(content in input), -/// fields: content.parse_terminated(Type::parse)?, +/// fields: content.parse_terminated(Type::parse, Token![,])?, /// semi_token: input.parse()?, /// }) /// } @@ -185,7 +186,7 @@ macro_rules! parenthesized { /// struct_token: input.parse()?, /// ident: input.parse()?, /// brace_token: braced!(content in input), -/// fields: content.parse_terminated(Field::parse)?, +/// fields: content.parse_terminated(Field::parse, Token![,])?, /// }) /// } /// } -- cgit v1.2.3