diff --git a/src/parse.rs b/src/parse.rs index b7f8831d67..57531005ac 100644 --- a/src/parse.rs +++ b/src/parse.rs @@ -502,7 +502,7 @@ impl<'a> ParseBuffer<'a> { /// } /// } /// ``` - pub fn call(&self, function: fn(ParseStream) -> Result) -> Result { + pub fn call(&'a self, function: fn(ParseStream<'a>) -> Result) -> Result { function(self) } @@ -732,8 +732,8 @@ impl<'a> ParseBuffer<'a> { /// } /// ``` pub fn parse_terminated( - &self, - parser: fn(ParseStream) -> Result, + &'a self, + parser: fn(ParseStream<'a>) -> Result, separator: P, ) -> Result> where diff --git a/src/punctuated.rs b/src/punctuated.rs index b26ed647f1..ebaaa94f9a 100644 --- a/src/punctuated.rs +++ b/src/punctuated.rs @@ -305,9 +305,9 @@ impl Punctuated { /// [`parse_terminated`]: Punctuated::parse_terminated #[cfg(feature = "parsing")] #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))] - pub fn parse_terminated_with( - input: ParseStream, - parser: fn(ParseStream) -> Result, + pub fn parse_terminated_with<'a>( + input: ParseStream<'a>, + parser: fn(ParseStream<'a>) -> Result, ) -> Result where P: Parse, @@ -357,9 +357,9 @@ impl Punctuated { /// [`parse_separated_nonempty`]: Punctuated::parse_separated_nonempty #[cfg(feature = "parsing")] #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))] - pub fn parse_separated_nonempty_with( - input: ParseStream, - parser: fn(ParseStream) -> Result, + pub fn parse_separated_nonempty_with<'a>( + input: ParseStream<'a>, + parser: fn(ParseStream<'a>) -> Result, ) -> Result where P: Token + Parse,