dbus2 / zbus-old

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

Large futures cause clippy to be triggered on programs which use `zbus::Connection::session()` #340

Open zeenix opened 1 year ago

zeenix commented 1 year ago

In GitLab by @TTWNO on Apr 20, 2023, 23:48

On beta and nightly, the new clippy lint large futures gets triggered when attempting to use the session connection:

error: large future with a size of 21448 bytes
   --> src/accessibility_connection.rs:291:16
    |
291 |     let session = zbus::Connection::session().await?;
    |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider `Box::pin` on it: `Box::pin(zbus::Connection::session())`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#large_futures

I'm not sure if this is really a problem worth fixing or not; I don't know how likely a stack overflow really is, but I thought it was worth mentioning.

You will need to use +nightly or +beta to see the lint.

zeenix commented 1 year ago

Thanks for filing this. I'm away at the moment. I'll try to look into it soon.