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 reason for this is that the feature when enabled on the mavlink crate will not be set on the mavlink-bindgencrate which uses it when generating code.
This can be fixed by adding the feature dependency in mavlink/Cargo.toml:
There is a further issue when doing that, since the parser will use serde(default = "crate::RustDefault::rust_default")) and RustDefault is a pub (crate) is a trait in mavlink-core but required in the mavlink crate when using emit-extensions.
The solution to this is making it fully public and importing it in mavlink/lib.rs. This does not create additional dependencies since mavlink already depends on mavlink-bindgen.
@@ -3,3 +3,6 @@
include!(concat!(env!("OUT_DIR"), "/mod.rs"));
pub use mavlink_core::*;
++#[cfg(feature = "emit-extensions")]+#[allow(unused_imports)]+pub (crate) use mavlink_core::utils::RustDefault;
The text was updated successfully, but these errors were encountered:
Hi @pv42! Thanks for creating the issues, I'm with no time at the moment to fix it myself, but I'm able to review and merge code, be free to submit PRs.
Thanks for the quick reply.
I just noticed that the emit-description feature seems to have the same issue, but since it only generates doc it does not break any builds.
I will probably submit a PR at least for this issue.
The feature
emit-extensions
that is supposed to enable mavlink v2 extension does not currently work for versions 0.13.x.This can be seen when comaparing the documentation (which enables all features) of version 0.12.2 and 0.13.1 on docs.rs for COMMAND_ACK_DATA:
https://docs.rs/mavlink/0.13.1/mavlink/common/struct.COMMAND_ACK_DATA.html only has the
command
andresult
fieldswhile https://docs.rs/mavlink/0.12.2/mavlink/common/struct.COMMAND_ACK_DATA.html also contains the extension fields.
The reason for this is that the feature when enabled on the
mavlink
crate will not be set on themavlink-bindgen
crate which uses it when generating code.This can be fixed by adding the feature dependency in
mavlink/Cargo.toml
:and adding the feature itself to mavlink-bindgen in
mavlink-bindgen/Cargo.toml
:There is a further issue when doing that, since the parser will use
serde(default = "crate::RustDefault::rust_default"))
and RustDefault is apub (crate)
is a trait inmavlink-core
but required in themavlink
crate when usingemit-extensions
.The solution to this is making it fully public and importing it in
mavlink/lib.rs
. This does not create additional dependencies since mavlink already depends on mavlink-bindgen.The text was updated successfully, but these errors were encountered: