diwic / dbus-rs

D-Bus binding for the Rust language
Other
585 stars 131 forks source link

`dbus-codegen-rust` produces `#[deprecated]` annotations on trait implementations #457

Closed MathisMARION closed 7 months ago

MathisMARION commented 7 months ago

I am getting a compilation error with generated D-Bus bindings using a deprecated method. I do not think the application context matters too much here, but I can provide more info if it helps. From my understanding, dbus-codegen-rust produces annotations on both trait declaration and trait implementations, while they should only be present in the declaration. I hope this is correct, I am quite new to Rust.

With Rust 1.41.1:

error: This deprecation annotation is useless
   --> wsbrddbusapi.rs:136:5
    |
136 | /     fn set_slot_algorithm(&self, arg0: u8) -> Result<(), dbus::Error> {
137 | |         self.method_call("com.silabs.Wisun.BorderRouter", "SetSlotAlgorithm", (arg0, ))
138 | |     }
    | |_____

With Rust 1.62.1:

error: this `#[deprecated]` annotation has no effect
   --> wsbrddbusapi.rs:135:5
    |
135 |     #[deprecated(note = "true")]
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove the unnecessary deprecation attribute
    |
    = note: `#[deny(useless_deprecated)]` on by default
MathisMARION commented 7 months ago

Thank you! I did not realize this had been fixed in the development branch. For reference: 5564e30