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
The interface and/or implementation of bindgen::callbacks::ParseCallbacks may need some changes to address a compile warning that may become an error in the future, see rust-lang/rust#79202. I'm guessing that the very least derives need to appear before other attributes?
I wish I remember what library it was, but I believe I already encountered a derive macro in the past that was very sensitive to order of everything and needed to be the very first one listed as well otherwise it would cause a compile error. If I come across it again, I'll be sure to update this issue.
Which causes a warning for derive helper being used before it is introduced, rust-lang/rust#79202:
warning: derive helper attribute is used before it is introduced
--> src/bindings.rs:6:3
|
6 | #[strum(serialize_all = "SCREAMING_SNAKE_CASE")]
| ^^^^^
7 | #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq, strum :: AsRefStr, strum :: IntoStaticStr)]
| ----------------- the attribute is introduced here
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #79202 <https://github.com/rust-lang/rust/issues/79202>
= note: `#[warn(legacy_derive_helpers)]` on by default
The interface and/or implementation of
bindgen::callbacks::ParseCallbacks
may need some changes to address a compile warning that may become an error in the future, see rust-lang/rust#79202. I'm guessing that the very least derives need to appear before other attributes?I wish I remember what library it was, but I believe I already encountered a derive macro in the past that was very sensitive to order of everything and needed to be the very first one listed as well otherwise it would cause a compile error. If I come across it again, I'll be sure to update this issue.
Details
From a header file with a type like:
Using the
item_name
,add_derives
,add_attributes
, andenum_variant_name
parse callbacks:Which causes a warning for derive helper being used before it is introduced,
rust-lang/rust#79202:
An example project is at https://github.com/kriswuollett/example-bindgen-derive-ordering/tree/0130dcd8fa3f8d0820ed53c711375152faa0cec2.
The text was updated successfully, but these errors were encountered: