Re: build warning in libgpiod rust bindings with rust 1.83

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.




[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux