mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-08 04:56:43 +00:00
rkyv-derived enums throw warnings that they are unused. Not sure how to get rid of them; I've tried surrounding them in `#[allow(dead_code)]` directives, and also explicitly creating each enum variant that I'm aware of through some dummy code and some log prints of the dummy code calls to ensure the results are used, and the warnings still persist. Significantly, the warnings only happen for enums that take a value. Simple rkyv enums do not throw a warning. These warnings overwhelm the build logs, so they need to be isolated in order for us to ensure that the build is clean of other more important warnings. The method chosen to isolate them is to take the enums that are problematic, carve them into their own special file, and add a file-wide `#![allow(dead_code)]` directive. This only happens in 7 service crates, and this change commits all of the modifications in a single big commit that could be undone later if this turns out to be a compiler regression or something similar. I also opened an issue with the rkyv maintainer to see what his opinion is on the situation. https://github.com/rkyv/rkyv/issues/318
19 lines
855 B
Rust
19 lines
855 B
Rust
// As of Rust 1.64.0:
|
|
//
|
|
// Rkyv-derived enums throw warnings that rkyv::Archive derived enums are never used
|
|
// and I can't figure out how to make them go away. Since they spam the build log,
|
|
// rkyv-derived enums are now isolated to their own file with a file-wide `dead_code`
|
|
// allow on top.
|
|
//
|
|
// This might be a temporary compiler regression, or it could just
|
|
// be yet another indicator that it's time to upgrade rkyv. However, we are waiting
|
|
// until rkyv hits 0.8 (the "shouldn't ever change again but still not sure enough
|
|
// for 1.0") release until we rework the entire system to chase the latest rkyv.
|
|
// As of now, the current version is 0.7.x and there isn't a timeline yet for 0.8.
|
|
#![allow(dead_code)]
|
|
|
|
#[derive(Debug, rkyv::Archive, rkyv::Serialize, rkyv::Deserialize)]
|
|
pub enum Return {
|
|
Prediction(crate::Prediction),
|
|
Failure,
|
|
}
|