Hello, trying to allow a lint for a specific struct, but running into an extra warning:
I got code like
#[derive(Debug, Message)]
pub struct ModLoadErrorMessage(pub Report);
and I get the suggestion from bevy lint:
warning: defined a message without a `Reflect` implementation
--> game/src/mods.rs:58:1
|
58 | pub struct ModLoadErrorMessage(pub Report);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: `Message` implemented here
--> game/src/mods.rs:56:17
|
56 | #[derive(Debug, Message)]
| ^^^^^^^
= note: requested on the command line with `-W bevy::missing-reflect`
= note: this warning originates in the derive macro `Message` (in Nightly builds, run with -Z macro-backtrace for more info)
help: `Reflect` can be automatically derived
|
58 + #[derive(Reflect)]
59 | pub struct ModLoadErrorMessage(pub Report);
|
I can't implement reflect for this message because Report is external non-reflect, and it wouldn't be useful to reflect it anyway, so I tried to ignore it by following the docs:
added #![cfg_attr(bevy_lint, feature(register_tool), register_tool(bevy))] to my main.rs, and put #[cfg_attr(bevy_lint, allow(bevy::missing_reflect))] on my struct like so:
#[derive(Debug, Message)]
#[cfg_attr(bevy_lint, allow(bevy::missing_reflect))]
pub struct ModLoadErrorMessage(pub Report);
it silenced the reflect warning, but instead a new warning appeared:
warning: allow(bevy::missing_reflect) is ignored unless specified at crate level
--> game/src/mods.rs:57:29
|
57 | #[cfg_attr(bevy_lint, allow(bevy::missing_reflect))]
| ^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(unused_attributes)]` (part of `#[warn(unused)]`) on by default