mirror of
https://github.com/bevyengine/bevy
synced 2024-11-21 20:23:28 +00:00
405fa3e8ea
# Objective ``` cargo check -p bevy_reflect ``` outputs a lot of warnings like: ``` warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item --> crates/bevy_reflect/src/impls/std.rs:223:13 | 223 | impl_type_path!($ty); | ^------------------- | | | `TypePath` is not local | move the `impl` block outside of this constant `_` and up 2 bodies ... 346 | / impl_reflect_for_atomic!( 347 | | ::core::sync::atomic::AtomicIsize, | | --------------------------------- `AtomicIsize` is not local 348 | | ::core::sync::atomic::Ordering::SeqCst 349 | | ); | |_- in this macro invocation | = note: the macro `impl_type_path` defines the non-local `impl`, and may need to be changed = note: the macro `impl_type_path` may come from an old version of the `bevy_reflect_derive` crate, try updating your dependency with `cargo update -p bevy_reflect_derive` = note: an `impl` is never scoped, even when it is nested inside an item, as it may impact type checking outside of that item, which can be the case if neither the trait or the self type are at the same nesting level as the `impl` = note: items in an anonymous const item (`const _: () = { ... }`) are treated as in the same scope as the anonymous const's declaration for the purpose of this lint = note: `#[warn(non_local_definitions)]` on by default = note: this warning originates in the macro `impl_type_path` which comes from the expansion of the macro `impl_reflect_for_atomic` (in Nightly builds, run with -Z macro-backtrace for more info) ``` ## Solution Move `impl_type_path!` into global scope. Warnings no longer pop up. ## Testing CI |
||
---|---|---|
.. | ||
bevy_a11y | ||
bevy_animation | ||
bevy_app | ||
bevy_asset | ||
bevy_audio | ||
bevy_color | ||
bevy_core | ||
bevy_core_pipeline | ||
bevy_derive | ||
bevy_dev_tools | ||
bevy_diagnostic | ||
bevy_dylib | ||
bevy_ecs | ||
bevy_encase_derive | ||
bevy_gilrs | ||
bevy_gizmos | ||
bevy_gltf | ||
bevy_hierarchy | ||
bevy_image | ||
bevy_input | ||
bevy_internal | ||
bevy_log | ||
bevy_macro_utils | ||
bevy_math | ||
bevy_mesh | ||
bevy_mikktspace | ||
bevy_pbr | ||
bevy_picking | ||
bevy_ptr | ||
bevy_reflect | ||
bevy_remote | ||
bevy_render | ||
bevy_scene | ||
bevy_sprite | ||
bevy_state | ||
bevy_tasks | ||
bevy_text | ||
bevy_time | ||
bevy_transform | ||
bevy_ui | ||
bevy_utils | ||
bevy_window | ||
bevy_winit |