From b3a2078eb91241f4537f702d01f7dda94cc14fdd Mon Sep 17 00:00:00 2001 From: raldone01 Date: Sun, 19 Jan 2025 21:29:11 +0100 Subject: [PATCH] Bump `cargo-manifest-proc-macros` to `0.3.2` to support older rust versions. --- Cargo.toml | 2 +- crates/bevy_asset/src/lib.rs | 1 - crates/bevy_asset/src/meta.rs | 4 +-- crates/bevy_ecs/src/entity/entity_set.rs | 1 - crates/bevy_ecs/src/event/base.rs | 1 - crates/bevy_ecs/src/hierarchy.rs | 1 - crates/bevy_ecs/src/query/iter.rs | 3 +- crates/bevy_ecs/src/query/mod.rs | 1 - crates/bevy_ecs/src/relationship/mod.rs | 1 - crates/bevy_ecs/src/schedule/condition.rs | 1 - crates/bevy_ecs/src/system/commands/mod.rs | 1 - crates/bevy_macro_utils/Cargo.toml | 2 +- crates/bevy_reflect/derive/src/meta.rs | 4 +-- crates/bevy_reflect/src/array.rs | 6 ++-- crates/bevy_reflect/src/enums/dynamic_enum.rs | 6 ++-- .../bevy_reflect/src/func/dynamic_function.rs | 1 - crates/bevy_reflect/src/impls/foldhash.rs | 2 +- crates/bevy_reflect/src/impls/petgraph.rs | 5 +--- crates/bevy_reflect/src/impls/smallvec.rs | 8 ++--- crates/bevy_reflect/src/impls/smol_str.rs | 4 +-- crates/bevy_reflect/src/impls/std.rs | 6 ++-- crates/bevy_reflect/src/impls/wgpu_types.rs | 2 +- crates/bevy_reflect/src/list.rs | 6 ++-- crates/bevy_reflect/src/map.rs | 6 ++-- crates/bevy_reflect/src/serde/de/mod.rs | 1 - crates/bevy_reflect/src/serde/mod.rs | 4 +-- crates/bevy_reflect/src/serde/ser/mod.rs | 1 - crates/bevy_reflect/src/set.rs | 6 ++-- crates/bevy_reflect/src/struct_trait.rs | 1 - crates/bevy_reflect/src/tuple.rs | 8 ++--- crates/bevy_reflect/src/tuple_struct.rs | 1 - tests-integration/simple-ecs-test/src/lib.rs | 29 ++++++++++++++----- 32 files changed, 60 insertions(+), 66 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index b623cf3128ac0e..180b1a0416ec3e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -492,7 +492,7 @@ serde = { version = "1", features = ["derive"] } serde_json = "1" bytemuck = "1.7" bevy_render = { path = "crates/bevy_render", version = "0.16.0-dev", default-features = false } -# The following explicit dependencies are needed for proc macros to work inside of examples in bevy itself. +# The following explicit dependencies are needed for proc macros to work inside of examples as they are part of the bevy crate itself. bevy_ecs = { path = "crates/bevy_ecs", version = "0.16.0-dev", default-features = false } bevy_state = { path = "crates/bevy_state", version = "0.16.0-dev", default-features = false } bevy_asset = { path = "crates/bevy_asset", version = "0.16.0-dev", default-features = false } diff --git a/crates/bevy_asset/src/lib.rs b/crates/bevy_asset/src/lib.rs index 7fbb442cd42d49..37dd05dd8eb41d 100644 --- a/crates/bevy_asset/src/lib.rs +++ b/crates/bevy_asset/src/lib.rs @@ -624,7 +624,6 @@ pub struct AssetEvents; #[cfg(test)] mod tests { use crate::{ - self as bevy_asset, folder::LoadedFolder, handle::Handle, io::{ diff --git a/crates/bevy_asset/src/meta.rs b/crates/bevy_asset/src/meta.rs index e15de6dd0c83a0..94da6b0b58383a 100644 --- a/crates/bevy_asset/src/meta.rs +++ b/crates/bevy_asset/src/meta.rs @@ -1,6 +1,6 @@ use crate::{ - self as bevy_asset, loader::AssetLoader, processor::Process, Asset, AssetPath, - DeserializeMetaError, VisitAssetDependencies, + loader::AssetLoader, processor::Process, Asset, AssetPath, DeserializeMetaError, + VisitAssetDependencies, }; use downcast_rs::{impl_downcast, Downcast}; use ron::ser::PrettyConfig; diff --git a/crates/bevy_ecs/src/entity/entity_set.rs b/crates/bevy_ecs/src/entity/entity_set.rs index e2d77a98fd46a8..3cd5486cc34847 100644 --- a/crates/bevy_ecs/src/entity/entity_set.rs +++ b/crates/bevy_ecs/src/entity/entity_set.rs @@ -389,7 +389,6 @@ mod tests { use crate::query::{QueryState, With}; use crate::system::Query; use crate::world::Mut; - use crate::{self as bevy_ecs}; use super::UniqueEntityIter; diff --git a/crates/bevy_ecs/src/event/base.rs b/crates/bevy_ecs/src/event/base.rs index b9f7ec8d055795..2b5c0905044ab6 100644 --- a/crates/bevy_ecs/src/event/base.rs +++ b/crates/bevy_ecs/src/event/base.rs @@ -1,4 +1,3 @@ -use crate as bevy_ecs; use crate::component::ComponentId; use crate::world::World; use crate::{component::Component, traversal::Traversal}; diff --git a/crates/bevy_ecs/src/hierarchy.rs b/crates/bevy_ecs/src/hierarchy.rs index 6e495a116b7f97..3295c122569587 100644 --- a/crates/bevy_ecs/src/hierarchy.rs +++ b/crates/bevy_ecs/src/hierarchy.rs @@ -12,7 +12,6 @@ use crate::reflect::{ ReflectVisitEntitiesMut, }; use crate::{ - self as bevy_ecs, bundle::Bundle, component::{Component, ComponentId}, entity::{Entity, VisitEntities}, diff --git a/crates/bevy_ecs/src/query/iter.rs b/crates/bevy_ecs/src/query/iter.rs index f17d1a1490c930..c28054880bb4a5 100644 --- a/crates/bevy_ecs/src/query/iter.rs +++ b/crates/bevy_ecs/src/query/iter.rs @@ -1500,7 +1500,7 @@ impl<'w, 's, D: QueryData, F: QueryFilter, I: Iterator> /// // We need to collect the internal iterator before iterating mutably /// let mut parent_query_iter = query.iter_many_mut(entity_list) /// .sort::(); - /// + /// /// let mut scratch_value = 0; /// while let Some(mut part_value) = parent_query_iter.fetch_next_back() /// { @@ -2965,7 +2965,6 @@ mod tests { use crate::component::Component; use crate::entity::Entity; use crate::prelude::World; - use crate::{self as bevy_ecs}; #[derive(Component, Debug, PartialEq, PartialOrd, Clone, Copy)] struct A(f32); diff --git a/crates/bevy_ecs/src/query/mod.rs b/crates/bevy_ecs/src/query/mod.rs index 6104d0a543abbf..384b82dee8a181 100644 --- a/crates/bevy_ecs/src/query/mod.rs +++ b/crates/bevy_ecs/src/query/mod.rs @@ -104,7 +104,6 @@ impl DebugCheckedUnwrap for Option { #[cfg(test)] mod tests { use crate::{ - self as bevy_ecs, archetype::Archetype, component::{Component, ComponentId, Components, Tick}, prelude::{AnyOf, Changed, Entity, Or, QueryState, Res, ResMut, Resource, With, Without}, diff --git a/crates/bevy_ecs/src/relationship/mod.rs b/crates/bevy_ecs/src/relationship/mod.rs index 54105c0d7391d7..020ee51cd79edd 100644 --- a/crates/bevy_ecs/src/relationship/mod.rs +++ b/crates/bevy_ecs/src/relationship/mod.rs @@ -229,7 +229,6 @@ pub trait RelationshipTarget: Component + Sized { #[cfg(test)] mod tests { - use crate as bevy_ecs; use crate::world::World; use crate::{component::Component, entity::Entity}; use alloc::vec::Vec; diff --git a/crates/bevy_ecs/src/schedule/condition.rs b/crates/bevy_ecs/src/schedule/condition.rs index 112d6d9481f4e5..600c27d3bc3f5d 100644 --- a/crates/bevy_ecs/src/schedule/condition.rs +++ b/crates/bevy_ecs/src/schedule/condition.rs @@ -1262,7 +1262,6 @@ where #[cfg(test)] mod tests { use super::{common_conditions::*, Condition}; - use crate as bevy_ecs; use crate::query::With; use crate::{ change_detection::ResMut, diff --git a/crates/bevy_ecs/src/system/commands/mod.rs b/crates/bevy_ecs/src/system/commands/mod.rs index af76e5db76ea0b..70d97537bb0f5a 100644 --- a/crates/bevy_ecs/src/system/commands/mod.rs +++ b/crates/bevy_ecs/src/system/commands/mod.rs @@ -19,7 +19,6 @@ use log::error; use core::panic::Location; use crate::{ - self as bevy_ecs, bundle::{Bundle, InsertMode}, change_detection::Mut, component::{Component, ComponentId, Mutable}, diff --git a/crates/bevy_macro_utils/Cargo.toml b/crates/bevy_macro_utils/Cargo.toml index b7b1978b977d40..42b79abe384ec8 100644 --- a/crates/bevy_macro_utils/Cargo.toml +++ b/crates/bevy_macro_utils/Cargo.toml @@ -12,7 +12,7 @@ keywords = ["bevy"] syn = "2.0" quote = "1.0" proc-macro2 = "1.0" -cargo-manifest-proc-macros = "0.3.1" +cargo-manifest-proc-macros = "0.3.2" [lints] workspace = true diff --git a/crates/bevy_reflect/derive/src/meta.rs b/crates/bevy_reflect/derive/src/meta.rs index 77de3cfc3af80d..2423dfafb37062 100644 --- a/crates/bevy_reflect/derive/src/meta.rs +++ b/crates/bevy_reflect/derive/src/meta.rs @@ -3,7 +3,5 @@ use syn::Path; /// Returns the correct path for `bevy_reflect`. pub(crate) fn get_bevy_reflect_path() -> Path { - let mut path = BevyManifest::shared().get_path("bevy_reflect"); - path.leading_colon = None; - path + BevyManifest::shared().get_path("bevy_reflect") } diff --git a/crates/bevy_reflect/src/array.rs b/crates/bevy_reflect/src/array.rs index 3deff6f315c6e3..300e69c2a71e90 100644 --- a/crates/bevy_reflect/src/array.rs +++ b/crates/bevy_reflect/src/array.rs @@ -1,8 +1,8 @@ use crate::generics::impl_generic_info_methods; use crate::{ - self as bevy_reflect, type_info::impl_type_methods, utility::reflect_hasher, ApplyError, - Generics, MaybeTyped, PartialReflect, Reflect, ReflectKind, ReflectMut, ReflectOwned, - ReflectRef, Type, TypeInfo, TypePath, + type_info::impl_type_methods, utility::reflect_hasher, ApplyError, Generics, MaybeTyped, + PartialReflect, Reflect, ReflectKind, ReflectMut, ReflectOwned, ReflectRef, Type, TypeInfo, + TypePath, }; use alloc::{boxed::Box, vec::Vec}; use bevy_reflect_derive::impl_type_path; diff --git a/crates/bevy_reflect/src/enums/dynamic_enum.rs b/crates/bevy_reflect/src/enums/dynamic_enum.rs index 9162ab3610eaf5..d9e228c07eaaea 100644 --- a/crates/bevy_reflect/src/enums/dynamic_enum.rs +++ b/crates/bevy_reflect/src/enums/dynamic_enum.rs @@ -1,9 +1,9 @@ use bevy_reflect_derive::impl_type_path; use crate::{ - self as bevy_reflect, enum_debug, enum_hash, enum_partial_eq, ApplyError, DynamicStruct, - DynamicTuple, Enum, PartialReflect, Reflect, ReflectKind, ReflectMut, ReflectOwned, ReflectRef, - Struct, Tuple, TypeInfo, VariantFieldIter, VariantType, + enum_debug, enum_hash, enum_partial_eq, ApplyError, DynamicStruct, DynamicTuple, Enum, + PartialReflect, Reflect, ReflectKind, ReflectMut, ReflectOwned, ReflectRef, Struct, Tuple, + TypeInfo, VariantFieldIter, VariantType, }; use alloc::{boxed::Box, string::String}; diff --git a/crates/bevy_reflect/src/func/dynamic_function.rs b/crates/bevy_reflect/src/func/dynamic_function.rs index 408cdda6400159..7bfd127c594b19 100644 --- a/crates/bevy_reflect/src/func/dynamic_function.rs +++ b/crates/bevy_reflect/src/func/dynamic_function.rs @@ -1,5 +1,4 @@ use crate::{ - self as bevy_reflect, __macro_exports::RegisterForReflection, func::{ args::{ArgCount, ArgList}, diff --git a/crates/bevy_reflect/src/impls/foldhash.rs b/crates/bevy_reflect/src/impls/foldhash.rs index a4f1df44efefc3..1b0452d433603e 100644 --- a/crates/bevy_reflect/src/impls/foldhash.rs +++ b/crates/bevy_reflect/src/impls/foldhash.rs @@ -1,4 +1,4 @@ -use crate::{self as bevy_reflect, impl_type_path}; +use crate::impl_type_path; impl_type_path!(::foldhash::fast::FoldHasher); impl_type_path!(::foldhash::fast::FixedState); diff --git a/crates/bevy_reflect/src/impls/petgraph.rs b/crates/bevy_reflect/src/impls/petgraph.rs index f9ab09e1b9f265..2264c9cb4b9b2a 100644 --- a/crates/bevy_reflect/src/impls/petgraph.rs +++ b/crates/bevy_reflect/src/impls/petgraph.rs @@ -1,7 +1,4 @@ -use crate::{ - self as bevy_reflect, impl_reflect_opaque, prelude::ReflectDefault, ReflectDeserialize, - ReflectSerialize, -}; +use crate::{impl_reflect_opaque, prelude::ReflectDefault, ReflectDeserialize, ReflectSerialize}; impl_reflect_opaque!(::petgraph::graph::NodeIndex( Default, diff --git a/crates/bevy_reflect/src/impls/smallvec.rs b/crates/bevy_reflect/src/impls/smallvec.rs index 5d92b03181fb94..afb75aff8d9978 100644 --- a/crates/bevy_reflect/src/impls/smallvec.rs +++ b/crates/bevy_reflect/src/impls/smallvec.rs @@ -4,10 +4,10 @@ use core::any::Any; use smallvec::{Array as SmallArray, SmallVec}; use crate::{ - self as bevy_reflect, utility::GenericTypeInfoCell, ApplyError, FromReflect, FromType, - Generics, GetTypeRegistration, List, ListInfo, ListIter, MaybeTyped, PartialReflect, Reflect, - ReflectFromPtr, ReflectKind, ReflectMut, ReflectOwned, ReflectRef, TypeInfo, TypeParamInfo, - TypePath, TypeRegistration, Typed, + utility::GenericTypeInfoCell, ApplyError, FromReflect, FromType, Generics, GetTypeRegistration, + List, ListInfo, ListIter, MaybeTyped, PartialReflect, Reflect, ReflectFromPtr, ReflectKind, + ReflectMut, ReflectOwned, ReflectRef, TypeInfo, TypeParamInfo, TypePath, TypeRegistration, + Typed, }; impl List for SmallVec diff --git a/crates/bevy_reflect/src/impls/smol_str.rs b/crates/bevy_reflect/src/impls/smol_str.rs index 7a0f99e2ed7fec..e2c09b206b3be7 100644 --- a/crates/bevy_reflect/src/impls/smol_str.rs +++ b/crates/bevy_reflect/src/impls/smol_str.rs @@ -1,6 +1,4 @@ -use crate::{ - self as bevy_reflect, std_traits::ReflectDefault, ReflectDeserialize, ReflectSerialize, -}; +use crate::{std_traits::ReflectDefault, ReflectDeserialize, ReflectSerialize}; use bevy_reflect_derive::impl_reflect_opaque; impl_reflect_opaque!(::smol_str::SmolStr( diff --git a/crates/bevy_reflect/src/impls/std.rs b/crates/bevy_reflect/src/impls/std.rs index a765dbd4bf7b5c..bcb3f70f36f158 100644 --- a/crates/bevy_reflect/src/impls/std.rs +++ b/crates/bevy_reflect/src/impls/std.rs @@ -4,7 +4,7 @@ )] use crate::{ - self as bevy_reflect, impl_type_path, map_apply, map_partial_eq, map_try_apply, + impl_type_path, map_apply, map_partial_eq, map_try_apply, prelude::ReflectDefault, reflect::impl_full_reflect, set_apply, set_partial_eq, set_try_apply, @@ -2428,8 +2428,8 @@ crate::func::macros::impl_function_traits!(&'static Location<'static>); #[cfg(test)] mod tests { use crate::{ - self as bevy_reflect, Enum, FromReflect, PartialReflect, Reflect, ReflectSerialize, - TypeInfo, TypeRegistry, Typed, VariantInfo, VariantType, + Enum, FromReflect, PartialReflect, Reflect, ReflectSerialize, TypeInfo, TypeRegistry, + Typed, VariantInfo, VariantType, }; use alloc::{collections::BTreeMap, string::String, vec}; use bevy_utils::{HashMap, Instant}; diff --git a/crates/bevy_reflect/src/impls/wgpu_types.rs b/crates/bevy_reflect/src/impls/wgpu_types.rs index 6f99b5d49699d6..b4a1750ba12427 100644 --- a/crates/bevy_reflect/src/impls/wgpu_types.rs +++ b/crates/bevy_reflect/src/impls/wgpu_types.rs @@ -1,4 +1,4 @@ -use crate::{self as bevy_reflect, impl_reflect_opaque, ReflectDeserialize, ReflectSerialize}; +use crate::{impl_reflect_opaque, ReflectDeserialize, ReflectSerialize}; impl_reflect_opaque!(::wgpu_types::TextureFormat( Debug, diff --git a/crates/bevy_reflect/src/list.rs b/crates/bevy_reflect/src/list.rs index 2aff62241f252f..e0f019c4b26dcf 100644 --- a/crates/bevy_reflect/src/list.rs +++ b/crates/bevy_reflect/src/list.rs @@ -9,9 +9,9 @@ use bevy_reflect_derive::impl_type_path; use crate::generics::impl_generic_info_methods; use crate::{ - self as bevy_reflect, type_info::impl_type_methods, utility::reflect_hasher, ApplyError, - FromReflect, Generics, MaybeTyped, PartialReflect, Reflect, ReflectKind, ReflectMut, - ReflectOwned, ReflectRef, Type, TypeInfo, TypePath, + type_info::impl_type_methods, utility::reflect_hasher, ApplyError, FromReflect, Generics, + MaybeTyped, PartialReflect, Reflect, ReflectKind, ReflectMut, ReflectOwned, ReflectRef, Type, + TypeInfo, TypePath, }; /// A trait used to power [list-like] operations via [reflection]. diff --git a/crates/bevy_reflect/src/map.rs b/crates/bevy_reflect/src/map.rs index 74743a0df1cbef..4d47efa207e674 100644 --- a/crates/bevy_reflect/src/map.rs +++ b/crates/bevy_reflect/src/map.rs @@ -4,9 +4,9 @@ use bevy_reflect_derive::impl_type_path; use bevy_utils::hashbrown::HashTable; use crate::{ - self as bevy_reflect, generics::impl_generic_info_methods, type_info::impl_type_methods, - ApplyError, Generics, MaybeTyped, PartialReflect, Reflect, ReflectKind, ReflectMut, - ReflectOwned, ReflectRef, Type, TypeInfo, TypePath, + generics::impl_generic_info_methods, type_info::impl_type_methods, ApplyError, Generics, + MaybeTyped, PartialReflect, Reflect, ReflectKind, ReflectMut, ReflectOwned, ReflectRef, Type, + TypeInfo, TypePath, }; use alloc::{boxed::Box, format, vec::Vec}; diff --git a/crates/bevy_reflect/src/serde/de/mod.rs b/crates/bevy_reflect/src/serde/de/mod.rs index e8b2df862ddb60..9f304cee8cb73b 100644 --- a/crates/bevy_reflect/src/serde/de/mod.rs +++ b/crates/bevy_reflect/src/serde/de/mod.rs @@ -38,7 +38,6 @@ mod tests { use bevy_utils::{HashMap, HashSet}; use crate::{ - self as bevy_reflect, serde::{ ReflectDeserializer, ReflectDeserializerProcessor, ReflectSerializer, TypedReflectDeserializer, diff --git a/crates/bevy_reflect/src/serde/mod.rs b/crates/bevy_reflect/src/serde/mod.rs index dcc38c3cc59871..cdeadac3be3625 100644 --- a/crates/bevy_reflect/src/serde/mod.rs +++ b/crates/bevy_reflect/src/serde/mod.rs @@ -10,8 +10,8 @@ pub use type_data::*; mod tests { use super::*; use crate::{ - self as bevy_reflect, type_registry::TypeRegistry, DynamicStruct, DynamicTupleStruct, - FromReflect, PartialReflect, Reflect, Struct, + type_registry::TypeRegistry, DynamicStruct, DynamicTupleStruct, FromReflect, + PartialReflect, Reflect, Struct, }; use serde::de::DeserializeSeed; diff --git a/crates/bevy_reflect/src/serde/ser/mod.rs b/crates/bevy_reflect/src/serde/ser/mod.rs index 77f2b9d0fe5d6f..f18a651571ff7b 100644 --- a/crates/bevy_reflect/src/serde/ser/mod.rs +++ b/crates/bevy_reflect/src/serde/ser/mod.rs @@ -21,7 +21,6 @@ mod tuples; #[cfg(test)] mod tests { use crate::{ - self as bevy_reflect, serde::{ReflectSerializer, ReflectSerializerProcessor}, PartialReflect, Reflect, ReflectSerialize, Struct, TypeRegistry, }; diff --git a/crates/bevy_reflect/src/set.rs b/crates/bevy_reflect/src/set.rs index 663b99715c0ee0..89209adba382b4 100644 --- a/crates/bevy_reflect/src/set.rs +++ b/crates/bevy_reflect/src/set.rs @@ -5,9 +5,9 @@ use bevy_reflect_derive::impl_type_path; use bevy_utils::hashbrown::{hash_table::OccupiedEntry as HashTableOccupiedEntry, HashTable}; use crate::{ - self as bevy_reflect, generics::impl_generic_info_methods, hash_error, - type_info::impl_type_methods, ApplyError, Generics, PartialReflect, Reflect, ReflectKind, - ReflectMut, ReflectOwned, ReflectRef, Type, TypeInfo, TypePath, + generics::impl_generic_info_methods, hash_error, type_info::impl_type_methods, ApplyError, + Generics, PartialReflect, Reflect, ReflectKind, ReflectMut, ReflectOwned, ReflectRef, Type, + TypeInfo, TypePath, }; /// A trait used to power [set-like] operations via [reflection]. diff --git a/crates/bevy_reflect/src/struct_trait.rs b/crates/bevy_reflect/src/struct_trait.rs index f90e9c5886c02c..e36d1fdd5e507e 100644 --- a/crates/bevy_reflect/src/struct_trait.rs +++ b/crates/bevy_reflect/src/struct_trait.rs @@ -1,6 +1,5 @@ use crate::generics::impl_generic_info_methods; use crate::{ - self as bevy_reflect, attributes::{impl_custom_attribute_methods, CustomAttributes}, type_info::impl_type_methods, ApplyError, Generics, NamedField, PartialReflect, Reflect, ReflectKind, ReflectMut, diff --git a/crates/bevy_reflect/src/tuple.rs b/crates/bevy_reflect/src/tuple.rs index 9790990a26bb70..28f95b6886cd8c 100644 --- a/crates/bevy_reflect/src/tuple.rs +++ b/crates/bevy_reflect/src/tuple.rs @@ -3,10 +3,10 @@ use variadics_please::all_tuples; use crate::generics::impl_generic_info_methods; use crate::{ - self as bevy_reflect, type_info::impl_type_methods, utility::GenericTypePathCell, ApplyError, - FromReflect, Generics, GetTypeRegistration, MaybeTyped, PartialReflect, Reflect, ReflectKind, - ReflectMut, ReflectOwned, ReflectRef, Type, TypeInfo, TypePath, TypeRegistration, TypeRegistry, - Typed, UnnamedField, + type_info::impl_type_methods, utility::GenericTypePathCell, ApplyError, FromReflect, Generics, + GetTypeRegistration, MaybeTyped, PartialReflect, Reflect, ReflectKind, ReflectMut, + ReflectOwned, ReflectRef, Type, TypeInfo, TypePath, TypeRegistration, TypeRegistry, Typed, + UnnamedField, }; use alloc::{boxed::Box, vec, vec::Vec}; use core::{ diff --git a/crates/bevy_reflect/src/tuple_struct.rs b/crates/bevy_reflect/src/tuple_struct.rs index 9ea90705911734..b0ac6687fbc468 100644 --- a/crates/bevy_reflect/src/tuple_struct.rs +++ b/crates/bevy_reflect/src/tuple_struct.rs @@ -2,7 +2,6 @@ use bevy_reflect_derive::impl_type_path; use crate::generics::impl_generic_info_methods; use crate::{ - self as bevy_reflect, attributes::{impl_custom_attribute_methods, CustomAttributes}, type_info::impl_type_methods, ApplyError, DynamicTuple, Generics, PartialReflect, Reflect, ReflectKind, ReflectMut, diff --git a/tests-integration/simple-ecs-test/src/lib.rs b/tests-integration/simple-ecs-test/src/lib.rs index 0b85d2e35c7d48..09eee5ed24372d 100644 --- a/tests-integration/simple-ecs-test/src/lib.rs +++ b/tests-integration/simple-ecs-test/src/lib.rs @@ -2,20 +2,35 @@ use bevy::prelude::*; #[derive(Component)] -struct _Component { - _value: f32, +struct MyComponent { + value: f32, } #[derive(Resource)] -struct _Resource { - _value: f32, +struct MyResource { + value: f32, } -fn hello_world() { - println!("hello world!"); +fn hello_world(query: Query<&MyComponent>, resource: Res) { + let component = query.iter().next().unwrap(); + let comp_value = component.value; // rust-analyzer suggestions work + let res_value_deref = resource.value; // rust-analyzer suggestions don't work but ctrl+click works once it's written, also type inlay hints work correctly + let res_value_direct = resource.into_inner().value; // rust-analyzer suggestions work + println!( + "hello world! Value: {} {} {}", + comp_value, res_value_deref, res_value_direct + ); +} + +fn spawn_component(mut commands: Commands) { + commands.spawn(MyComponent { value: 10.0 }); } #[test] fn simple_ecs_test() { - App::new().add_systems(Update, hello_world).run(); + App::new() + .insert_resource(MyResource { value: 5.0 }) + .add_systems(Startup, spawn_component) + .add_systems(Update, hello_world) + .run(); }