dbus2 / zbus-old

Rust D-Bus crate.
https://gitlab.freedesktop.org/dbus/zbus
Other
49 stars 13 forks source link

Compilation failed because "error[E0700]: hidden type for 'impl Trait' captures lifetime that does not appear in bounds" #278

Closed zeenix closed 1 year ago

zeenix commented 2 years ago

In GitLab by @Oreolicious on Jun 16, 2022, 14:21

Description

Tried running a rust API server in a docker container, but it fails to run because zbus v2.3.1 doesn't compile. Could also be an issue on my end but I'm totally lost as to what is going on here.

How to reproduce

  1. clone https://github.com/snamiki1212/realworld-v1-rust-actix-web-diesel
  2. sh ./scripts/copy-env.sh
  3. docker compose up -d

Console output

Compiling zbus v2.3.1
error[E0700]: hidden type for 'impl Trait' captures lifetime that does not appear in bounds
--> /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/zbus-2.3.1/src/object_server.rs:464:10
|
| ) -> Result
| ^^^^^^^^^^^^
|
note: hidden type 'impl futures_core::Future' captures lifetime smaller than the function body
--> /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/zbus-2.3.1/src/object_server.rs:464:10
|
| ) -> Result
| ^^^^^^^^^^^^

For more information about this error, try 'rustc --explain E0700'.
error: failed to compile 'cargo-watch v8.1.1', intermediate artifacts can be found at '/tmp/cargo-installzbZPlx'

Caused by:
could not compile 'zbus' due to previous error

zeenix commented 2 years ago

Thanks for reporting. Which version of rust compiler this is? We may have unintentionally bumped the requirement to satisfy a new clippy warning. See if reverting !505 helps.

zeenix commented 2 years ago

In GitLab by @Oreolicious on Jun 16, 2022, 15:43

The dockerfile specified FROM rust:1.56.1. I bumped it up to the newest release 1.61.0 which ended up compiling! Looks like the maintainers of the server I cloned didn't bump the version in quite a while. I feel silly I didn't try that earlier.

zeenix commented 2 years ago

Cool, no worries. I wish there was a way for us to know when we bump our MSRV.

zeenix commented 2 years ago

In GitLab by @ollpu on Jul 19, 2022, 15:27

The general approach is to run (at least part of) the CI at the targeted to MSRV. Then you'll know immediately if it's bumped.

zeenix commented 2 years ago

@ollpu Kiitos! I added to me todo now.

zeenix commented 2 years ago

@ollpu Hi, could you actually explain a bit more, how this is done?

zeenix commented 2 years ago

In GitLab by @ollpu on Jul 23, 2022, 19:53

@zeenix I've filed https://gitlab.freedesktop.org/dbus/zbus/-/merge_requests/535. Waiting to verify that the CI still works.