plugin_not_ending_in_plugin and main_return_without_appexit check for impl blocks, but emit the lint on the original structure definition. This results in confusing locations for #[allow(...)] attributes:
// This doesn't actually silence the lint.
#[allow(bevy::plugin_not_ending_in_plugin)]
struct Foo;
// But this does.
#[allow(bevy::plugin_not_ending_in_plugin)]
impl Plugin for Foo {
fn build(&self, _app: &mut App) {}
}
This can be fixed by calling span_lint_hir(), which lets you specify the HirId of the item that the lint is attached to.
This PR switches main_return_without_appexit and plugin_not_ending_in_plugin to specify the HirId of the structure definition, not the impl block, making the #[allow(...)] location more intuitive.
Fixes #132.
plugin_not_ending_in_plugin
andmain_return_without_appexit
check forimpl
blocks, but emit the lint on the original structure definition. This results in confusing locations for#[allow(...)]
attributes:This can be fixed by calling
span_lint_hir()
, which lets you specify theHirId
of the item that the lint is attached to.This PR switches
main_return_without_appexit
andplugin_not_ending_in_plugin
to specify theHirId
of the structure definition, not theimpl
block, making the#[allow(...)]
location more intuitive.