From: Kent Gibson <warthog618@gmail.com>
To: Bartosz Golaszewski <brgl@bgdev.pl>
Cc: Viresh Kumar <viresh.kumar@linaro.org>,
"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
Erik Schilling <erik.schilling@linaro.org>
Subject: Re: build warning in libgpiod rust bindings with rust 1.83
Date: Sat, 21 Dec 2024 10:01:02 +0800 [thread overview]
Message-ID: <20241221020102.GA45199@rigel> (raw)
In-Reply-To: <CAMRc=Me-QNmJ2L1K-gGzFtVZacsDiLsNUfh3QaWPdbVzyxUduA@mail.gmail.com>
On Fri, Dec 20, 2024 at 05:25:16PM +0100, Bartosz Golaszewski wrote:
> Hi Viresh et al,
>
> I noticed the following warning when building libgpiod rust bindings
> with rust 1.83:
>
> warning: elided lifetime has a name
> --> libgpiod/src/line_request.rs:234:26
> |
> 231 | pub fn read_edge_events<'a>(
> | -- lifetime `'a` declared here
> ...
> 234 | ) -> Result<request::Events> {
> | ^^^^^^ this elided lifetime gets resolved as `'a`
> |
> = note: `#[warn(elided_named_lifetimes)]` on by default
>
> Could you please take a look as I have no idea what that means?
>
clippy is complaining that the lifetime of the returned object is implicit.
Try:
--- a/bindings/rust/libgpiod/src/line_request.rs
+++ b/bindings/rust/libgpiod/src/line_request.rs
@@ -231,7 +231,7 @@ impl Request {
pub fn read_edge_events<'a>(
&'a self,
buffer: &'a mut request::Buffer,
- ) -> Result<request::Events> {
+ ) -> Result<request::Events<'a>> {
buffer.read_edge_events(self)
}
}
to make it explicit.
Cheers,
Kent.
next prev parent reply other threads:[~2024-12-21 2:01 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-20 16:25 build warning in libgpiod rust bindings with rust 1.83 Bartosz Golaszewski
2024-12-21 2:01 ` Kent Gibson [this message]
2025-01-02 7:42 ` Erik Schilling
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241221020102.GA45199@rigel \
--to=warthog618@gmail.com \
--cc=brgl@bgdev.pl \
--cc=erik.schilling@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=viresh.kumar@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.