Skip to content

Commit d974838

Browse files
committed
feat: support bevy v0.18.0-rc.1
1 parent 2037e19 commit d974838

File tree

11 files changed

+477
-507
lines changed

11 files changed

+477
-507
lines changed

Cargo.lock

Lines changed: 435 additions & 246 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bevy_lint/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ toml = { version = "0.9.8", default-features = false, features = [
5454

5555
[dev-dependencies]
5656
# Used when running UI tests.
57-
bevy = { version = "0.17.2", default-features = false, features = [
57+
bevy = { version = "0.18.0-rc.1", default-features = false, features = [
5858
"std",
5959
# used for the `camera_modification_in_fixed_update` lint
6060
"bevy_render",

bevy_lint/src/lints/suspicious/insert_message_resource.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,7 @@ fn check_insert_resource(cx: &LateContext<'_>, method_call: &MethodCall) {
119119
let ty = cx.typeck_results().expr_ty_adjusted(arg);
120120

121121
// If `arg` is `Messages<T>`, emit the lint.
122-
// `Events<T>` got deprecated for `Messages<T>` in `0.17`.
123-
if crate::paths::EVENTS.matches_ty(cx, ty) || crate::paths::MESSAGES.matches_ty(cx, ty) {
122+
if crate::paths::MESSAGES.matches_ty(cx, ty) {
124123
let mut applicability = Applicability::MachineApplicable;
125124

126125
let message_ty_snippet = extract_ty_message_snippet(ty, &mut applicability);
@@ -198,10 +197,7 @@ fn check_init_resource<'tcx>(cx: &LateContext<'tcx>, method_call: &MethodCall<'t
198197
let resource_ty = ty_from_hir_ty(cx, resource_hir_ty.as_unambig_ty());
199198

200199
// If the resource type is `Messages<T>`, emit the lint.
201-
// `Events<T>` got deprecated for `Messages<T>` in `0.17`.
202-
if crate::paths::EVENTS.matches_ty(cx, resource_ty)
203-
|| crate::paths::MESSAGES.matches_ty(cx, resource_ty)
204-
{
200+
if crate::paths::MESSAGES.matches_ty(cx, resource_ty) {
205201
let mut applicability = Applicability::MachineApplicable;
206202

207203
let message_ty_snippet = extract_hir_message_snippet(

bevy_lint/src/lints/suspicious/iter_current_update_messages.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,7 @@ impl<'tcx> LateLintPass<'tcx> for IterCurrentUpdateMessages {
8282
.expr_ty_adjusted(method_call.receiver)
8383
.peel_refs();
8484

85-
// Events is deprecated in favor of `Messages` in bevy `0.17`
86-
if !(crate::paths::EVENTS.matches_ty(cx, src_ty)
87-
|| crate::paths::MESSAGES.matches_ty(cx, src_ty))
88-
{
85+
if !(crate::paths::MESSAGES.matches_ty(cx, src_ty)) {
8986
return;
9087
}
9188

bevy_lint/src/paths.rs

Lines changed: 36 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -21,68 +21,66 @@ macro_rules! type_path {
2121

2222
// Keep the following list alphabetically sorted :)
2323

24-
/// <https://github.com/bevyengine/bevy/blob/v0.17.2/crates/bevy_app/src/app.rs#L80>
24+
/// <https://github.com/bevyengine/bevy/blob/v0.18.0-rc.1/crates/bevy_app/src/app.rs#L84>
2525
pub static APP: PathLookup = type_path!(bevy_app::app::App);
26-
/// <https://github.com/bevyengine/bevy/blob/v0.17.2/crates/bevy_ecs/src/bundle/mod.rs#L200>
26+
/// <https://github.com/bevyengine/bevy/blob/v0.18.0-rc.1/crates/bevy_ecs/src/bundle/mod.rs#L200>
2727
pub static BUNDLE: PathLookup = type_path!(bevy_ecs::bundle::Bundle);
28-
/// <https://github.com/bevyengine/bevy/blob/v0.17.2/crates/bevy_camera/src/camera.rs#L343>
28+
/// <https://github.com/bevyengine/bevy/blob/v0.18.0-rc.1/crates/bevy_camera/src/camera.rs#L349>
2929
pub static CAMERA: PathLookup = type_path!(bevy_camera::camera::Camera);
30-
/// <https://github.com/bevyengine/bevy/blob/v0.17.2/crates/bevy_ecs/src/system/commands/mod.rs#L102>
30+
/// <https://github.com/bevyengine/bevy/blob/v0.18.0-rc.1/crates/bevy_ecs/src/system/commands/mod.rs#L105>
3131
pub static COMMANDS: PathLookup = type_path!(bevy_ecs::system::commands::Commands);
32-
/// <https://github.com/bevyengine/bevy/blob/v0.17.2/crates/bevy_ecs/src/component/mod.rs#L487>
32+
/// <https://github.com/bevyengine/bevy/blob/v0.18.0-rc.1/crates/bevy_ecs/src/component/mod.rs#L509>
3333
pub static COMPONENT: PathLookup = type_path!(bevy_ecs::component::Component);
34-
/// <https://github.com/bevyengine/bevy/blob/v0.17.2/crates/bevy_ecs/src/world/deferred_world.rs#L28>
34+
/// <https://github.com/bevyengine/bevy/blob/v0.18.0-rc.1/crates/bevy_ecs/src/world/deferred_world.rs#L28>
3535
pub static DEFERRED_WORLD: PathLookup = type_path!(bevy_ecs::world::deferred_world::DeferredWorld);
36-
/// <https://github.com/bevyengine/bevy/blob/v0.17.2/crates/bevy_ecs/src/system/system_param.rs#L1253>
36+
/// <https://github.com/bevyengine/bevy/blob/v0.18.0-rc.1/crates/bevy_ecs/src/system/system_param.rs#L1301>
3737
pub static DEFERRED: PathLookup = type_path!(bevy_ecs::system::system_param::Deferred);
38-
/// <https://github.com/bevyengine/bevy/blob/v0.17.2/crates/bevy_ecs/src/system/commands/mod.rs#L1259>
38+
/// <https://github.com/bevyengine/bevy/blob/v0.18.0-rc.1/crates/bevy_ecs/src/system/commands/mod.rs#L1282>
3939
pub static ENTITY_COMMANDS: PathLookup = type_path!(bevy_ecs::system::EntityCommands);
40-
/// <https://github.com/bevyengine/bevy/blob/v0.17.2/crates/bevy_ecs/src/world/entity_ref.rs#L450>
41-
pub static ENTITY_MUT: PathLookup = type_path!(bevy_ecs::world::entity_ref::EntityMut);
42-
/// <https://github.com/bevyengine/bevy/blob/v0.17.2/crates/bevy_ecs/src/event/mod.rs#L88>
40+
/// <https://github.com/bevyengine/bevy/blob/v0.18.0-rc.1/crates/bevy_ecs/src/world/entity_access/entity_mut.rs#L42>
41+
pub static ENTITY_MUT: PathLookup = type_path!(bevy_ecs::world::entity_access::EntityMut);
42+
/// <https://github.com/bevyengine/bevy/blob/v0.18.0-rc.1/crates/bevy_ecs/src/event/mod.rs#L88>
4343
pub static EVENT: PathLookup = type_path!(bevy_ecs::event::Event);
44-
/// <https://github.com/bevyengine/bevy/blob/v0.17.2/crates/bevy_ecs/src/event/mod.rs#L358>
45-
pub static EVENTS: PathLookup = type_path!(bevy_ecs::event::Events);
46-
/// <https://github.com/bevyengine/bevy/blob/v0.17.2/crates/bevy_ecs/src/world/entity_ref.rs#L3516>
44+
/// <https://github.com/bevyengine/bevy/blob/v0.18.0-rc.1/crates/bevy_ecs/src/world/entity_access/filtered.rs#L358>
4745
pub static FILTERED_ENTITY_MUT: PathLookup =
48-
type_path!(bevy_ecs::world::entity_ref::FilteredEntityMut);
49-
/// <https://github.com/bevyengine/bevy/blob/v0.17.2/crates/bevy_app/src/main_schedule.rs#L132>
46+
type_path!(bevy_ecs::world::entity_access::FilteredEntityMut);
47+
/// <https://github.com/bevyengine/bevy/blob/v0.18.0-rc.1/crates/bevy_app/src/main_schedule.rs#L133>
5048
pub static FIXED_UPDATE: PathLookup = type_path!(bevy_app::main_schedule::FixedUpdate);
51-
/// <https://github.com/bevyengine/bevy/blob/v0.17.2/crates/bevy_ecs/src/message/mod.rs#L96>
49+
/// <https://github.com/bevyengine/bevy/blob/v0.18.0-rc.1/crates/bevy_ecs/src/message/mod.rs#L96>
5250
pub static MESSAGE: PathLookup = type_path!(bevy_ecs::message::Message);
53-
/// <https://github.com/bevyengine/bevy/blob/v0.17.2/crates/bevy_ecs/src/message/messages.rs#L95>
51+
/// <https://githu.com/bevyengine/bevy/blob/v0.18.0-rc.1/crates/bevy_ecs/src/message/messages.rs#L95>
5452
pub static MESSAGES: PathLookup = type_path!(bevy_ecs::message::Messages);
55-
/// <https://github.com/bevyengine/bevy/blob/v0.17.2/crates/bevy_ecs/src/change_detection.rs#L1035>
56-
pub static MUT_UNTYPED: PathLookup = type_path!(bevy_ecs::change_detection::MutUntyped);
57-
/// <https://github.com/bevyengine/bevy/blob/v0.17.2/crates/bevy_ecs/src/change_detection.rs#L935>
58-
pub static MUT: PathLookup = type_path!(bevy_ecs::change_detection::Mut);
59-
/// <https://github.com/bevyengine/bevy/blob/v0.17.2/crates/bevy_ecs/src/change_detection.rs#L773>
60-
pub static NON_SEND_MUT: PathLookup = type_path!(bevy_ecs::change_detection::NonSendMut);
61-
/// <https://github.com/bevyengine/bevy/blob/v0.17.2/crates/bevy_reflect/src/reflect.rs#L99>
53+
/// <https://github.com/bevyengine/bevy/blob/v0.18.0-rc.1/crates/bevy_ecs/src/change_detection/params.rs#L513>
54+
pub static MUT_UNTYPED: PathLookup = type_path!(bevy_ecs::change_detection::params::MutUntyped);
55+
/// <https://github.com/bevyengine/bevy/blob/v0.18.0-rc.1/crates/bevy_ecs/src/change_detection/params.rs#L415>
56+
pub static MUT: PathLookup = type_path!(bevy_ecs::change_detection::params::Mut);
57+
/// <https://github.com/bevyengine/bevy/blob/v0.18.0-rc.1/crates/bevy_ecs/src/change_detection/params.rs#L257>
58+
pub static NON_SEND_MUT: PathLookup = type_path!(bevy_ecs::change_detection::params::NonSendMut);
59+
/// <https://github.com/bevyengine/bevy/blob/v0.18.0-rc.1/crates/bevy_reflect/src/reflect.rs#L99>
6260
pub static PARTIAL_REFLECT: PathLookup = type_path!(bevy_reflect::reflect::PartialReflect);
63-
/// <https://github.com/bevyengine/bevy/blob/v0.17.2/crates/bevy_app/src/plugin.rs#L57>
61+
/// <https://github.com/bevyengine/bevy/blob/v0.18.0-rc.1/crates/bevy_app/src/plugin.rs#L57>
6462
pub static PLUGIN: PathLookup = type_path!(bevy_app::plugin::Plugin);
65-
/// <https://github.com/bevyengine/bevy/blob/v0.17.2/crates/bevy_ptr/src/lib.rs#L303>
63+
/// <https://github.com/bevyengine/bevy/blob/v0.18.0-rc.1/crates/bevy_ptr/src/lib.rs#L307>
6664
pub static PTR_MUT: PathLookup = type_path!(bevy_ptr::PtrMut);
67-
/// <https://github.com/bevyengine/bevy/blob/v0.17.2/crates/bevy_ecs/src/system/query.rs#L485>
65+
/// <https://github.com/bevyengine/bevy/blob/v0.18.0-rc.1/crates/bevy_ecs/src/system/query.rs#L485>
6866
pub static QUERY: PathLookup = type_path!(bevy_ecs::system::query::Query);
69-
/// <https://github.com/bevyengine/bevy/blob/v0.17.2/crates/bevy_reflect/src/reflect.rs#L415>
67+
/// <https://github.com/bevyengine/bevy/blob/v0.18.0-rc.1/crates/bevy_reflect/src/reflect.rs#L415>
7068
pub static REFLECT: PathLookup = type_path!(bevy_reflect::reflect::Reflect);
71-
/// <https://github.com/bevyengine/bevy/blob/v0.17.2/crates/bevy_ecs/src/relationship/related_methods.rs#L565>
69+
/// <https://github.com/bevyengine/bevy/blob/v0.18.0-rc.1/crates/bevy_ecs/src/relationship/related_methods.rs#L565>
7270
pub static RELATED_SPAWNER: PathLookup =
7371
type_path!(bevy_ecs::relationship::related_methods::RelatedSpawner);
74-
/// <https://github.com/bevyengine/bevy/blob/v0.17.2/crates/bevy_ecs/src/relationship/related_methods.rs#L611>
72+
/// <https://github.com/bevyengine/bevy/blob/v0.18.0-rc.1/crates/bevy_ecs/src/relationship/related_methods.rs#L611>
7573
pub static RELATED_SPAWNER_COMMANDS: PathLookup =
7674
type_path!(bevy_ecs::relationship::related_methods::RelatedSpawnerCommands);
77-
/// <https://github.com/bevyengine/bevy/blob/v0.17.2/crates/bevy_ecs/src/change_detection.rs#L714>
78-
pub static RES_MUT: PathLookup = type_path!(bevy_ecs::change_detection::ResMut);
79-
/// <https://github.com/bevyengine/bevy/blob/v0.17.2/crates/bevy_ecs/src/resource.rs#L75>
75+
/// <https://github.com/bevyengine/bevy/blob/v0.18.0-rc.1/crates/bevy_ecs/src/change_detection/params.rs#L172>
76+
pub static RES_MUT: PathLookup = type_path!(bevy_ecs::change_detection::params::ResMut);
77+
/// <https://github.com/bevyengine/bevy/blob/v0.18.0-rc.1/crates/bevy_ecs/src/resource.rs#L75>
8078
pub static RESOURCE: PathLookup = type_path!(bevy_ecs::resource::Resource);
81-
/// <https://github.com/bevyengine/bevy/blob/v0.17.2/crates/bevy_ecs/src/schedule/set.rs#L154>
79+
/// <https://github.com/bevyengine/bevy/blob/v0.18.0-rc.1/crates/bevy_ecs/src/schedule/set.rs#L154>
8280
pub static SYSTEM_SET: PathLookup = type_path!(bevy_ecs::schedule::set::SystemSet);
83-
/// <https://github.com/bevyengine/bevy/blob/v0.17.2/crates/bevy_app/src/main_schedule.rs#L172>
81+
/// <https://github.com/bevyengine/bevy/blob/v0.18.0-rc.1/crates/bevy_app/src/main_schedule.rs#L173>
8482
pub static UPDATE: PathLookup = type_path!(bevy_app::main_schedule::Update);
85-
/// <https://github.com/bevyengine/bevy/blob/v0.17.2/crates/bevy_ecs/src/query/filter.rs#L141>
83+
/// <https://github.com/bevyengine/bevy/blob/v0.18.0-rc.1/crates/bevy_ecs/src/query/filter.rs#L142>
8684
pub static WITH: PathLookup = type_path!(bevy_ecs::query::filter::With);
87-
/// <https://github.com/bevyengine/bevy/blob/v0.17.2/crates/bevy_ecs/src/world/mod.rs#L90>
85+
/// <https://github.com/bevyengine/bevy/blob/v0.18.0-rc.1/crates/bevy_ecs/src/world/mod.rs#L92>
8886
pub static WORLD: PathLookup = type_path!(bevy_ecs::world::World);

bevy_lint/src/sym.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,12 +158,14 @@ declare_bevy_symbols! {
158158
commands,
159159
component,
160160
deferred_world,
161+
entity_access,
161162
entity_ref,
162163
event,
163164
init_resource,
164165
insert_resource,
165166
iter_current_update_messages,
166167
main_schedule,
168+
params,
167169
query,
168170
related_methods,
169171
relationship,

bevy_lint/tests/ui/insert_message_resource/events.fixed

Lines changed: 0 additions & 37 deletions
This file was deleted.

bevy_lint/tests/ui/insert_message_resource/events.rs

Lines changed: 0 additions & 37 deletions
This file was deleted.

bevy_lint/tests/ui/insert_message_resource/events.stderr

Lines changed: 0 additions & 105 deletions
This file was deleted.

bevy_lint/tests/ui/iter_current_update_messages/events.rs

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)