Skip to content

Commit 0b82b2e

Browse files
committed
Bump cargo-manifest-proc-macros to 0.3.2 to support older rust versions.
1 parent c3eccdc commit 0b82b2e

File tree

9 files changed

+25
-16
lines changed

9 files changed

+25
-16
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ serde = { version = "1", features = ["derive"] }
492492
serde_json = "1"
493493
bytemuck = "1.7"
494494
bevy_render = { path = "crates/bevy_render", version = "0.16.0-dev", default-features = false }
495-
# The following explicit dependencies are needed for proc macros to work inside of examples in bevy itself.
495+
# The following explicit dependencies are needed for proc macros to work inside of examples as they are part of the bevy crate itself.
496496
bevy_ecs = { path = "crates/bevy_ecs", version = "0.16.0-dev", default-features = false }
497497
bevy_state = { path = "crates/bevy_state", version = "0.16.0-dev", default-features = false }
498498
bevy_asset = { path = "crates/bevy_asset", version = "0.16.0-dev", default-features = false }

crates/bevy_ecs/src/entity/entity_set.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,6 @@ mod tests {
389389
use crate::query::{QueryState, With};
390390
use crate::system::Query;
391391
use crate::world::Mut;
392-
use crate::{self as bevy_ecs};
393392

394393
use super::UniqueEntityIter;
395394

crates/bevy_ecs/src/event/base.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
use crate as bevy_ecs;
21
use crate::component::ComponentId;
32
use crate::world::World;
43
use crate::{component::Component, traversal::Traversal};

crates/bevy_ecs/src/hierarchy.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ use crate::reflect::{
1212
ReflectVisitEntitiesMut,
1313
};
1414
use crate::{
15-
self as bevy_ecs,
1615
bundle::Bundle,
1716
component::{Component, ComponentId},
1817
entity::{Entity, VisitEntities},

crates/bevy_ecs/src/query/iter.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1500,7 +1500,7 @@ impl<'w, 's, D: QueryData, F: QueryFilter, I: Iterator<Item: EntityBorrow>>
15001500
/// // We need to collect the internal iterator before iterating mutably
15011501
/// let mut parent_query_iter = query.iter_many_mut(entity_list)
15021502
/// .sort::<Entity>();
1503-
///
1503+
///
15041504
/// let mut scratch_value = 0;
15051505
/// while let Some(mut part_value) = parent_query_iter.fetch_next_back()
15061506
/// {
@@ -2965,7 +2965,6 @@ mod tests {
29652965
use crate::component::Component;
29662966
use crate::entity::Entity;
29672967
use crate::prelude::World;
2968-
use crate::{self as bevy_ecs};
29692968

29702969
#[derive(Component, Debug, PartialEq, PartialOrd, Clone, Copy)]
29712970
struct A(f32);

crates/bevy_ecs/src/relationship/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,6 @@ pub trait RelationshipTarget: Component<Mutability = Mutable> + Sized {
229229

230230
#[cfg(test)]
231231
mod tests {
232-
use crate as bevy_ecs;
233232
use crate::world::World;
234233
use crate::{component::Component, entity::Entity};
235234
use alloc::vec::Vec;

crates/bevy_ecs/src/schedule/condition.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1262,7 +1262,6 @@ where
12621262
#[cfg(test)]
12631263
mod tests {
12641264
use super::{common_conditions::*, Condition};
1265-
use crate as bevy_ecs;
12661265
use crate::query::With;
12671266
use crate::{
12681267
change_detection::ResMut,

crates/bevy_macro_utils/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ keywords = ["bevy"]
1212
syn = "2.0"
1313
quote = "1.0"
1414
proc-macro2 = "1.0"
15-
cargo-manifest-proc-macros = "0.3.1"
15+
cargo-manifest-proc-macros = "0.3.2"
1616

1717
[lints]
1818
workspace = true

tests-integration/simple-ecs-test/src/lib.rs

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,35 @@
22
use bevy::prelude::*;
33

44
#[derive(Component)]
5-
struct _Component {
6-
_value: f32,
5+
struct MyComponent {
6+
value: f32,
77
}
88

99
#[derive(Resource)]
10-
struct _Resource {
11-
_value: f32,
10+
struct MyResource {
11+
value: f32,
1212
}
1313

14-
fn hello_world() {
15-
println!("hello world!");
14+
fn hello_world(query: Query<&MyComponent>, resource: Res<MyResource>) {
15+
let component = query.iter().next().unwrap();
16+
let comp_value = component.value; // rust-analyzer suggestions work
17+
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
18+
let res_value_direct = resource.into_inner().value; // rust-analyzer suggestions work
19+
println!(
20+
"hello world! Value: {} {} {}",
21+
comp_value, res_value_deref, res_value_direct
22+
);
23+
}
24+
25+
fn spawn_component(mut commands: Commands) {
26+
commands.spawn(MyComponent { value: 10.0 });
1627
}
1728

1829
#[test]
1930
fn simple_ecs_test() {
20-
App::new().add_systems(Update, hello_world).run();
31+
App::new()
32+
.insert_resource(MyResource { value: 5.0 })
33+
.add_systems(Startup, spawn_component)
34+
.add_systems(Update, hello_world)
35+
.run();
2136
}

0 commit comments

Comments
 (0)