You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After a cargo update which bumped glib-macros to 0.18.2, I've got several of clippy warnings in Relm4:
warning: this method could have a `#[must_use]` attribute
--> relm4/src/binding/bindings.rs:59:17
|
59 | #[property(get, set)]
| ^ help: add the attribute: `#[must_use] #`
...
101 | binding!(StringBinding, "StringBinding", String, imp_strin...
| ------------------------------------------------------------ in this macro invocation
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
= note: this warning originates in the macro `binding` (in Nightly builds, run with -Z macro-backtrace for more info)
It seems like the macro is using quote_spanned since #1149, which makes clippy think that the user forget to add a #[must_use] if you enabled the clippy::must_use_candidate lint for your project. quote_spanned might help to improve the error reporting, but it can also trigger unexpected clippy lints.
To solve this, either #[must_use] should be added to the generated methods or the spans have to be adjusted carefully to make it clear for clippy that those tokens were produced by a macro.
Steps to reproduce
Use the property macro
Enable the clippy::must_use_candidate lint
Rust cargo clippy
The text was updated successfully, but these errors were encountered:
Bug description
After a
cargo update
which bumped glib-macros to 0.18.2, I've got several of clippy warnings in Relm4:It seems like the macro is using
quote_spanned
since #1149, which makes clippy think that the user forget to add a#[must_use]
if you enabled theclippy::must_use_candidate
lint for your project.quote_spanned
might help to improve the error reporting, but it can also trigger unexpected clippy lints.To solve this, either
#[must_use]
should be added to the generated methods or the spans have to be adjusted carefully to make it clear for clippy that those tokens were produced by a macro.Steps to reproduce
clippy::must_use_candidate
lintcargo clippy
The text was updated successfully, but these errors were encountered: