Skip to content

Commit

Permalink
Bump cargo-manifest-proc-macros to 0.3.2 to support older rust ve…
Browse files Browse the repository at this point in the history
…rsions.
  • Loading branch information
raldone01 committed Jan 19, 2025
1 parent c3eccdc commit b3a2078
Show file tree
Hide file tree
Showing 32 changed files with 60 additions and 66 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
1 change: 0 additions & 1 deletion crates/bevy_asset/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,6 @@ pub struct AssetEvents;
#[cfg(test)]
mod tests {
use crate::{
self as bevy_asset,
folder::LoadedFolder,
handle::Handle,
io::{
Expand Down
4 changes: 2 additions & 2 deletions crates/bevy_asset/src/meta.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
1 change: 0 additions & 1 deletion crates/bevy_ecs/src/entity/entity_set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
1 change: 0 additions & 1 deletion crates/bevy_ecs/src/event/base.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use crate as bevy_ecs;
use crate::component::ComponentId;
use crate::world::World;
use crate::{component::Component, traversal::Traversal};
Expand Down
1 change: 0 additions & 1 deletion crates/bevy_ecs/src/hierarchy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ use crate::reflect::{
ReflectVisitEntitiesMut,
};
use crate::{
self as bevy_ecs,
bundle::Bundle,
component::{Component, ComponentId},
entity::{Entity, VisitEntities},
Expand Down
3 changes: 1 addition & 2 deletions crates/bevy_ecs/src/query/iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1500,7 +1500,7 @@ impl<'w, 's, D: QueryData, F: QueryFilter, I: Iterator<Item: EntityBorrow>>
/// // We need to collect the internal iterator before iterating mutably
/// let mut parent_query_iter = query.iter_many_mut(entity_list)
/// .sort::<Entity>();
///
///
/// let mut scratch_value = 0;
/// while let Some(mut part_value) = parent_query_iter.fetch_next_back()
/// {
Expand Down Expand Up @@ -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);
Expand Down
1 change: 0 additions & 1 deletion crates/bevy_ecs/src/query/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ impl<T> DebugCheckedUnwrap for Option<T> {
#[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},
Expand Down
1 change: 0 additions & 1 deletion crates/bevy_ecs/src/relationship/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,6 @@ pub trait RelationshipTarget: Component<Mutability = Mutable> + Sized {

#[cfg(test)]
mod tests {
use crate as bevy_ecs;
use crate::world::World;
use crate::{component::Component, entity::Entity};
use alloc::vec::Vec;
Expand Down
1 change: 0 additions & 1 deletion crates/bevy_ecs/src/schedule/condition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 0 additions & 1 deletion crates/bevy_ecs/src/system/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_macro_utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions crates/bevy_reflect/derive/src/meta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
6 changes: 3 additions & 3 deletions crates/bevy_reflect/src/array.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
6 changes: 3 additions & 3 deletions crates/bevy_reflect/src/enums/dynamic_enum.rs
Original file line number Diff line number Diff line change
@@ -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};
Expand Down
1 change: 0 additions & 1 deletion crates/bevy_reflect/src/func/dynamic_function.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use crate::{
self as bevy_reflect,
__macro_exports::RegisterForReflection,
func::{
args::{ArgCount, ArgList},
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_reflect/src/impls/foldhash.rs
Original file line number Diff line number Diff line change
@@ -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);
Expand Down
5 changes: 1 addition & 4 deletions crates/bevy_reflect/src/impls/petgraph.rs
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
8 changes: 4 additions & 4 deletions crates/bevy_reflect/src/impls/smallvec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<T: SmallArray + TypePath + Send + Sync> List for SmallVec<T>
Expand Down
4 changes: 1 addition & 3 deletions crates/bevy_reflect/src/impls/smol_str.rs
Original file line number Diff line number Diff line change
@@ -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(
Expand Down
6 changes: 3 additions & 3 deletions crates/bevy_reflect/src/impls/std.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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};
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_reflect/src/impls/wgpu_types.rs
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
6 changes: 3 additions & 3 deletions crates/bevy_reflect/src/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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].
Expand Down
6 changes: 3 additions & 3 deletions crates/bevy_reflect/src/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};

Expand Down
1 change: 0 additions & 1 deletion crates/bevy_reflect/src/serde/de/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ mod tests {
use bevy_utils::{HashMap, HashSet};

use crate::{
self as bevy_reflect,
serde::{
ReflectDeserializer, ReflectDeserializerProcessor, ReflectSerializer,
TypedReflectDeserializer,
Expand Down
4 changes: 2 additions & 2 deletions crates/bevy_reflect/src/serde/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
1 change: 0 additions & 1 deletion crates/bevy_reflect/src/serde/ser/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ mod tuples;
#[cfg(test)]
mod tests {
use crate::{
self as bevy_reflect,
serde::{ReflectSerializer, ReflectSerializerProcessor},
PartialReflect, Reflect, ReflectSerialize, Struct, TypeRegistry,
};
Expand Down
6 changes: 3 additions & 3 deletions crates/bevy_reflect/src/set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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].
Expand Down
1 change: 0 additions & 1 deletion crates/bevy_reflect/src/struct_trait.rs
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
8 changes: 4 additions & 4 deletions crates/bevy_reflect/src/tuple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::{
Expand Down
1 change: 0 additions & 1 deletion crates/bevy_reflect/src/tuple_struct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
29 changes: 22 additions & 7 deletions tests-integration/simple-ecs-test/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<MyResource>) {
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();
}

0 comments on commit b3a2078

Please sign in to comment.