dbus2 / zbus-old

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

zbus_macros doesn't compile with `no method named `value`` error #279

Closed zeenix closed 1 year ago

zeenix commented 2 years ago

In GitLab by @thomy2000 on Jun 17, 2022, 14:00

When compiling the zbus_macros crate, I get this error and it doesn't compile properly. It's pulled from crates.io so it should be the newest version.

error[E0599]: no method named `value` found for reference `&LitBool` in the current scope
  --> /home/thomas/.cargo/registry/src/github.com-1ecc6299db9ec823/zbus_macros-2.3.1/src/proxy.rs:77:41
   |
77 |                         gen_async = lit.value();
   |                                         ^^^^^-- help: remove the arguments
   |                                         |
   |                                         field, not a method

error[E0599]: no method named `value` found for reference `&LitBool` in the current scope
  --> /home/thomas/.cargo/registry/src/github.com-1ecc6299db9ec823/zbus_macros-2.3.1/src/proxy.rs:83:44
   |
83 |                         gen_blocking = lit.value();
   |                                            ^^^^^-- help: remove the arguments
   |                                            |
   |                                            field, not a method

For more information about this error, try `rustc --explain E0599`.
error: could not compile `zbus_macros` due to 2 previous errors
warning: build failed, waiting for other jobs to finish...
zeenix commented 2 years ago

Looks like your syn crate might be super old? This method was added 5 years ago.

zeenix commented 2 years ago

Actually, it was added just last year. I'll bump the syn crate requirement. Thanks for reporting.

zeenix commented 2 years ago

When compiling the zbus_macros crate, I get this error and it doesn't compile properly. It's pulled from crates.io so it should be the newest version.

BTW, it's recommended to use zbus_macros through zbus instead of using it directly. It won't help with this issue but just a general tip.

zeenix commented 2 years ago

mentioned in commit c53ee487855151b36d616dcc8c8b6c08d118814d