From 9a071926953ad0961630dbeb174fc1b3735df0a4 Mon Sep 17 00:00:00 2001 From: DaAlbrecht Date: Thu, 8 May 2025 23:32:31 +0200 Subject: [PATCH 01/14] feat: start new lint --- Cargo.lock | 1234 ++++++++++++++++- bevy_lint/Cargo.toml | 6 +- .../camera_modification_in_fixed_update.rs | 50 + bevy_lint/src/lints/nursery/mod.rs | 7 + bevy_lint/src/paths.rs | 4 + .../main.rs | 36 + 6 files changed, 1291 insertions(+), 46 deletions(-) create mode 100644 bevy_lint/src/lints/nursery/camera_modification_in_fixed_update.rs create mode 100644 bevy_lint/tests/ui/camera_modification_in_fixed_update/main.rs diff --git a/Cargo.lock b/Cargo.lock index cc9cee00..918ddc4b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -62,7 +62,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef6978589202a00cd7e118380c448a08b6ed394c3a8df3a430d0898e3a42d046" dependencies = [ "android-properties", - "bitflags", + "bitflags 2.9.0", "cc", "cesu8", "jni", @@ -71,7 +71,7 @@ dependencies = [ "log", "ndk", "ndk-context", - "ndk-sys", + "ndk-sys 0.6.0+11769913", "num_enum", "thiserror 1.0.69", ] @@ -88,6 +88,15 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "84521a3cf562bc62942e294181d9eef17eb38ceb8c68677bc49f144e4c3d4f8d" +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + [[package]] name = "annotate-snippets" version = "0.11.5" @@ -178,6 +187,12 @@ dependencies = [ "num-traits", ] +[[package]] +name = "arrayref" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb" + [[package]] name = "arrayvec" version = "0.7.6" @@ -193,6 +208,15 @@ dependencies = [ "stable_deref_trait", ] +[[package]] +name = "ash" +version = "0.38.0+1.3.281" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bb44936d800fea8f016d7f2311c6a4f97aebd5dc86f09906139ec848cf3a46f" +dependencies = [ + "libloading", +] + [[package]] name = "assert_cmd" version = "2.0.17" @@ -220,6 +244,30 @@ dependencies = [ "syn", ] +[[package]] +name = "async-broadcast" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "435a87a52755b8f27fcf321ac4f04b2802e337c8c4872923137471ec39c37532" +dependencies = [ + "event-listener", + "event-listener-strategy", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-channel" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89b47800b0be77592da0afd425cc03468052844aff33b84e33cc696f64e77b6a" +dependencies = [ + "concurrent-queue", + "event-listener-strategy", + "futures-core", + "pin-project-lite", +] + [[package]] name = "async-executor" version = "1.13.1" @@ -233,6 +281,28 @@ dependencies = [ "slab", ] +[[package]] +name = "async-fs" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebcd09b382f40fcd159c2d695175b2ae620ffa5f3bd6f664131efff4e8b9e04a" +dependencies = [ + "async-lock", + "blocking", + "futures-lite", +] + +[[package]] +name = "async-lock" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18" +dependencies = [ + "event-listener", + "event-listener-strategy", + "pin-project-lite", +] + [[package]] name = "async-task" version = "4.7.1" @@ -251,6 +321,16 @@ dependencies = [ "portable-atomic", ] +[[package]] +name = "atomicow" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f52e8890bb9844440d0c412fa74b67fd2f14e85248b6e00708059b6da9e5f8bf" +dependencies = [ + "portable-atomic", + "portable-atomic-util", +] + [[package]] name = "auth-git2" version = "0.5.7" @@ -275,7 +355,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "de45108900e1f9b9242f7f2e254aa3e2c029c921c258fe9e6b4217eeebd54288" dependencies = [ "axum-core", - "base64", + "base64 0.22.1", "bytes", "futures-util", "http", @@ -336,6 +416,12 @@ dependencies = [ "rustc-demangle", ] +[[package]] +name = "base64" +version = "0.21.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" + [[package]] name = "base64" version = "0.22.1" @@ -387,6 +473,58 @@ dependencies = [ "web-sys", ] +[[package]] +name = "bevy_asset" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0698040d63199391ea77fd02e039630748e3e335c3070c6d932fd96cbf80f5d6" +dependencies = [ + "async-broadcast", + "async-fs", + "async-lock", + "atomicow", + "bevy_app", + "bevy_asset_macros", + "bevy_ecs", + "bevy_platform", + "bevy_reflect", + "bevy_tasks", + "bevy_utils", + "bevy_window", + "bitflags 2.9.0", + "blake3", + "crossbeam-channel", + "derive_more", + "disqualified", + "downcast-rs", + "either", + "futures-io", + "futures-lite", + "js-sys", + "parking_lot", + "ron", + "serde", + "stackfuture", + "thiserror 2.0.12", + "tracing", + "uuid", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "bevy_asset_macros" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf8c00b5d532f8e5ac7b49af10602f9f7774a2d522cf0638323b5dfeee7b31c" +dependencies = [ + "bevy_macro_utils", + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "bevy_cli" version = "0.1.0-dev" @@ -427,11 +565,42 @@ dependencies = [ "bevy_reflect", "bytemuck", "derive_more", + "encase", "serde", "thiserror 2.0.12", "wgpu-types", ] +[[package]] +name = "bevy_core_pipeline" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55c2310717b9794e4a45513ee5946a7be0838852a4c1e185884195e1a8688ff3" +dependencies = [ + "bevy_app", + "bevy_asset", + "bevy_color", + "bevy_derive", + "bevy_diagnostic", + "bevy_ecs", + "bevy_image", + "bevy_math", + "bevy_platform", + "bevy_reflect", + "bevy_render", + "bevy_transform", + "bevy_utils", + "bevy_window", + "bitflags 2.9.0", + "bytemuck", + "nonmax", + "radsort", + "serde", + "smallvec", + "thiserror 2.0.12", + "tracing", +] + [[package]] name = "bevy_derive" version = "0.16.0" @@ -473,7 +642,7 @@ dependencies = [ "bevy_reflect", "bevy_tasks", "bevy_utils", - "bitflags", + "bitflags 2.9.0", "bumpalo", "concurrent-queue", "derive_more", @@ -500,6 +669,77 @@ dependencies = [ "syn", ] +[[package]] +name = "bevy_encase_derive" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8bb31dc1090c6f8fabbf6b21994d19a12766e786885ee48ffc547f0f1fa7863" +dependencies = [ + "bevy_macro_utils", + "encase_derive_impl", +] + +[[package]] +name = "bevy_gizmos" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54af8145b35ab2a830a6dd1058e23c1e1ddc4b893db79d295259ef82f51c7520" +dependencies = [ + "bevy_app", + "bevy_asset", + "bevy_color", + "bevy_core_pipeline", + "bevy_ecs", + "bevy_gizmos_macros", + "bevy_image", + "bevy_math", + "bevy_reflect", + "bevy_render", + "bevy_time", + "bevy_transform", + "bevy_utils", + "bytemuck", + "tracing", +] + +[[package]] +name = "bevy_gizmos_macros" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40137ace61f092b7a09eba41d7d1e6aef941f53a7818b06ef86dcce7b6a1fd3f" +dependencies = [ + "bevy_macro_utils", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "bevy_image" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "840b25f7f58894c641739f756959028a04f519c448db7e2cd3e2e29fc5fd188d" +dependencies = [ + "bevy_app", + "bevy_asset", + "bevy_color", + "bevy_math", + "bevy_platform", + "bevy_reflect", + "bevy_utils", + "bitflags 2.9.0", + "bytemuck", + "futures-lite", + "guillotiere", + "half", + "image", + "rectangle-pack", + "serde", + "thiserror 2.0.12", + "tracing", + "wgpu-types", +] + [[package]] name = "bevy_input" version = "0.16.0" @@ -545,12 +785,16 @@ dependencies = [ "bevy_derive", "bevy_diagnostic", "bevy_ecs", + "bevy_gizmos", + "bevy_image", "bevy_input", "bevy_input_focus", "bevy_math", "bevy_platform", "bevy_ptr", "bevy_reflect", + "bevy_render", + "bevy_scene", "bevy_state", "bevy_tasks", "bevy_time", @@ -624,6 +868,40 @@ dependencies = [ "variadics_please", ] +[[package]] +name = "bevy_mesh" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12af58280c7453e32e2f083d86eaa4c9b9d03ea8683977108ded8f1930c539f2" +dependencies = [ + "bevy_asset", + "bevy_derive", + "bevy_ecs", + "bevy_image", + "bevy_math", + "bevy_mikktspace", + "bevy_platform", + "bevy_reflect", + "bevy_transform", + "bevy_utils", + "bitflags 2.9.0", + "bytemuck", + "hexasphere", + "serde", + "thiserror 2.0.12", + "tracing", + "wgpu-types", +] + +[[package]] +name = "bevy_mikktspace" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75e0258423c689f764556e36b5d9eebdbf624b29a1fd5b33cd9f6c42dcc4d5f3" +dependencies = [ + "glam", +] + [[package]] name = "bevy_platform" version = "0.16.0" @@ -687,6 +965,90 @@ dependencies = [ "uuid", ] +[[package]] +name = "bevy_render" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85a7306235b3343b032801504f3e884b93abfb7ba58179fc555c479df509f349" +dependencies = [ + "async-channel", + "bevy_app", + "bevy_asset", + "bevy_color", + "bevy_derive", + "bevy_diagnostic", + "bevy_ecs", + "bevy_encase_derive", + "bevy_image", + "bevy_math", + "bevy_mesh", + "bevy_platform", + "bevy_reflect", + "bevy_render_macros", + "bevy_tasks", + "bevy_time", + "bevy_transform", + "bevy_utils", + "bevy_window", + "bitflags 2.9.0", + "bytemuck", + "codespan-reporting", + "derive_more", + "downcast-rs", + "encase", + "fixedbitset", + "futures-lite", + "image", + "indexmap", + "js-sys", + "naga", + "naga_oil", + "nonmax", + "offset-allocator", + "send_wrapper", + "serde", + "smallvec", + "thiserror 2.0.12", + "tracing", + "variadics_please", + "wasm-bindgen", + "web-sys", + "wgpu", +] + +[[package]] +name = "bevy_render_macros" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b85c4fb26b66d3a257b655485d11b9b6df9d3c85026493ba8092767a5edfc1b2" +dependencies = [ + "bevy_macro_utils", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "bevy_scene" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7b628f560f2d2fe9f35ecd4526627ba3992f082de03fd745536e4053a0266fe" +dependencies = [ + "bevy_app", + "bevy_asset", + "bevy_derive", + "bevy_ecs", + "bevy_platform", + "bevy_reflect", + "bevy_render", + "bevy_transform", + "bevy_utils", + "derive_more", + "serde", + "thiserror 2.0.12", + "uuid", +] + [[package]] name = "bevy_state" version = "0.16.0" @@ -799,24 +1161,60 @@ dependencies = [ ] [[package]] -name = "bindgen" -version = "0.70.1" +name = "bindgen" +version = "0.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f49d8fed880d473ea71efb9bf597651e77201bdd4893efe54c9e5d65ae04ce6f" +dependencies = [ + "bitflags 2.9.0", + "cexpr", + "clang-sys", + "itertools 0.13.0", + "log", + "prettyplease", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "syn", +] + +[[package]] +name = "bit-set" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" +dependencies = [ + "bit-vec 0.6.3", +] + +[[package]] +name = "bit-set" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3" +dependencies = [ + "bit-vec 0.8.0", +] + +[[package]] +name = "bit-vec" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" + +[[package]] +name = "bit-vec" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f49d8fed880d473ea71efb9bf597651e77201bdd4893efe54c9e5d65ae04ce6f" -dependencies = [ - "bitflags", - "cexpr", - "clang-sys", - "itertools 0.13.0", - "log", - "prettyplease", - "proc-macro2", - "quote", - "regex", - "rustc-hash", - "shlex", - "syn", -] +checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" @@ -827,6 +1225,25 @@ dependencies = [ "serde", ] +[[package]] +name = "blake3" +version = "1.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3888aaa89e4b2a40fca9848e400f6a658a5a3978de7be858e209cafa8be9a4a0" +dependencies = [ + "arrayref", + "arrayvec", + "cc", + "cfg-if", + "constant_time_eq", +] + +[[package]] +name = "block" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" + [[package]] name = "block-buffer" version = "0.10.4" @@ -836,6 +1253,19 @@ dependencies = [ "generic-array", ] +[[package]] +name = "blocking" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "703f41c54fc768e63e091340b424302bb1c29ef4aa0c7f10fe849dfb114d29ea" +dependencies = [ + "async-channel", + "async-task", + "futures-io", + "futures-lite", + "piper", +] + [[package]] name = "bstr" version = "1.12.0" @@ -879,6 +1309,12 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" +[[package]] +name = "byteorder-lite" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495" + [[package]] name = "bytes" version = "1.10.1" @@ -1100,6 +1536,16 @@ dependencies = [ "serde", ] +[[package]] +name = "codespan-reporting" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" +dependencies = [ + "termcolor", + "unicode-width 0.1.14", +] + [[package]] name = "color-eyre" version = "0.6.3" @@ -1218,6 +1664,33 @@ dependencies = [ "tiny-keccak", ] +[[package]] +name = "const_panic" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2459fc9262a1aa204eb4b5764ad4f189caec88aea9634389c0a25f8be7f6265e" + +[[package]] +name = "const_soft_float" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87ca1caa64ef4ed453e68bb3db612e51cf1b2f5b871337f0fcab1c8f87cc3dff" + +[[package]] +name = "constant_time_eq" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c74b8349d32d297c9134b8c88677813a227df8f779daa29bfc29c183fe3dca6" + +[[package]] +name = "constgebra" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1aaf9b65849a68662ac6c0810c8893a765c960b907dd7cfab9c4a50bf764fbc" +dependencies = [ + "const_soft_float", +] + [[package]] name = "core-foundation" version = "0.9.4" @@ -1244,6 +1717,17 @@ version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" +[[package]] +name = "core-graphics-types" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45390e6114f68f718cc7a830514a96f903cccd70d02a8f6d9f643ac4ba45afaf" +dependencies = [ + "bitflags 1.3.2", + "core-foundation 0.9.4", + "libc", +] + [[package]] name = "cpufeatures" version = "0.2.17" @@ -1446,6 +1930,15 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" +[[package]] +name = "document-features" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95249b50c6c185bee49034bcb378a49dc2b5dff0be90ff6616d31d64febab05d" +dependencies = [ + "litrs", +] + [[package]] name = "downcast-rs" version = "2.0.1" @@ -1458,6 +1951,38 @@ version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" +[[package]] +name = "encase" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0a05902cf601ed11d564128448097b98ebe3c6574bd7b6a653a3d56d54aa020" +dependencies = [ + "const_panic", + "encase_derive", + "glam", + "thiserror 1.0.69", +] + +[[package]] +name = "encase_derive" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "181d475b694e2dd56ae919ce7699d344d1fd259292d590c723a50d1189a2ea85" +dependencies = [ + "encase_derive_impl", +] + +[[package]] +name = "encase_derive_impl" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f97b51c5cc57ef7c5f7a0c57c250251c49ee4c28f819f87ac32f4aceabc36792" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "encode_unicode" version = "1.0.0" @@ -1513,6 +2038,36 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "euclid" +version = "0.22.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad9cdb4b747e485a12abb0e6566612956c7a1bafa3bdb8d682c5b6d403589e48" +dependencies = [ + "num-traits", +] + +[[package]] +name = "event-listener" +version = "5.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3492acde4c3fc54c845eaab3eed8bd00c7a7d881f78bfc801e43a93dec1331ae" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + +[[package]] +name = "event-listener-strategy" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8be9f3dfaaffdae2972880079a491a1a8bb7cbed0b8dd7a347f668b4150a3b93" +dependencies = [ + "event-listener", + "pin-project-lite", +] + [[package]] name = "eyre" version = "0.6.12" @@ -1572,7 +2127,28 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" dependencies = [ - "foreign-types-shared", + "foreign-types-shared 0.1.1", +] + +[[package]] +name = "foreign-types" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965" +dependencies = [ + "foreign-types-macros", + "foreign-types-shared 0.3.1", +] + +[[package]] +name = "foreign-types-macros" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" +dependencies = [ + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -1581,6 +2157,12 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" +[[package]] +name = "foreign-types-shared" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" + [[package]] name = "form_urlencoded" version = "1.2.1" @@ -1756,7 +2338,7 @@ version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5220b8ba44c68a9a7f7a7659e864dd73692e417ef0211bea133c7b74e031eeb9" dependencies = [ - "bitflags", + "bitflags 2.9.0", "libc", "libgit2-sys", "log", @@ -1806,7 +2388,7 @@ version = "0.14.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8dc2c844c4cf141884678cabef736fd91dd73068b9146e6f004ba1a0457944b6" dependencies = [ - "bitflags", + "bitflags 2.9.0", "bstr", "gix-path", "libc", @@ -1885,7 +2467,7 @@ version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "20972499c03473e773a2099e5fd0c695b9b72465837797a51a43391a1635a030" dependencies = [ - "bitflags", + "bitflags 2.9.0", "bstr", "gix-features 0.41.1", "gix-path", @@ -1999,7 +2581,7 @@ version = "0.10.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "47aeb0f13de9ef2f3033f5ff218de30f44db827ac9f1286f9ef050aacddd5888" dependencies = [ - "bitflags", + "bitflags 2.9.0", "gix-path", "libc", "windows-sys 0.52.0", @@ -2064,6 +2646,17 @@ dependencies = [ "thiserror 2.0.12", ] +[[package]] +name = "gl_generator" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a95dfc23a2b4a9a2f5ab41d194f8bfda3cabec42af4e39f08c339eb2a0c124d" +dependencies = [ + "khronos_api", + "log", + "xml-rs", +] + [[package]] name = "glam" version = "0.29.3" @@ -2072,6 +2665,7 @@ checksum = "8babf46d4c1c9d92deac9f7be466f76dfc4482b6452fc5024b5e8daf6ffeb3ee" dependencies = [ "bytemuck", "libm", + "rand 0.8.5", "serde", ] @@ -2094,6 +2688,98 @@ dependencies = [ "regex-syntax 0.8.5", ] +[[package]] +name = "glow" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5e5ea60d70410161c8bf5da3fdfeaa1c72ed2c15f8bbb9d19fe3a4fad085f08" +dependencies = [ + "js-sys", + "slotmap", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "glutin_wgl_sys" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c4ee00b289aba7a9e5306d57c2d05499b2e5dc427f84ac708bd2c090212cf3e" +dependencies = [ + "gl_generator", +] + +[[package]] +name = "gpu-alloc" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbcd2dba93594b227a1f57ee09b8b9da8892c34d55aa332e034a228d0fe6a171" +dependencies = [ + "bitflags 2.9.0", + "gpu-alloc-types", +] + +[[package]] +name = "gpu-alloc-types" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98ff03b468aa837d70984d55f5d3f846f6ec31fe34bbb97c4f85219caeee1ca4" +dependencies = [ + "bitflags 2.9.0", +] + +[[package]] +name = "gpu-allocator" +version = "0.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c151a2a5ef800297b4e79efa4f4bec035c5f51d5ae587287c9b952bdf734cacd" +dependencies = [ + "log", + "presser", + "thiserror 1.0.69", + "windows", +] + +[[package]] +name = "gpu-descriptor" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcf29e94d6d243368b7a56caa16bc213e4f9f8ed38c4d9557069527b5d5281ca" +dependencies = [ + "bitflags 2.9.0", + "gpu-descriptor-types", + "hashbrown 0.15.2", +] + +[[package]] +name = "gpu-descriptor-types" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdf242682df893b86f33a73828fb09ca4b2d3bb6cc95249707fc684d27484b91" +dependencies = [ + "bitflags 2.9.0", +] + +[[package]] +name = "guillotiere" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b62d5865c036cb1393e23c50693df631d3f5d7bcca4c04fe4cc0fd592e74a782" +dependencies = [ + "euclid", + "svg_fmt", +] + +[[package]] +name = "half" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "459196ed295495a68f7d7fe1d84f6c4b7ff0e21fe3017b2f283c6fac3ad803c9" +dependencies = [ + "cfg-if", + "crunchy", +] + [[package]] name = "hash32" version = "0.3.1" @@ -2116,6 +2802,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" dependencies = [ "equivalent", + "foldhash", "serde", ] @@ -2136,6 +2823,23 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" +[[package]] +name = "hexasphere" +version = "15.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9c9e718d32b6e6b2b32354e1b0367025efdd0b11d6a740b905ddf5db1074679" +dependencies = [ + "constgebra", + "glam", + "tinyvec", +] + +[[package]] +name = "hexf-parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfa686283ad6dd069f105e5ab091b04c62850d3e4cf5d67debad1933f55023df" + [[package]] name = "home" version = "0.5.11" @@ -2408,6 +3112,17 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "image" +version = "0.25.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db35664ce6b9810857a38a906215e75a9c879f0696556a39f59c62829710251a" +dependencies = [ + "bytemuck", + "byteorder-lite", + "num-traits", +] + [[package]] name = "indenter" version = "0.3.3" @@ -2575,6 +3290,23 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "khronos-egl" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6aae1df220ece3c0ada96b8153459b67eebe9ae9212258bb0134ae60416fdf76" +dependencies = [ + "libc", + "libloading", + "pkg-config", +] + +[[package]] +name = "khronos_api" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc" + [[package]] name = "kstring" version = "2.0.2" @@ -2639,7 +3371,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags", + "bitflags 2.9.0", "libc", ] @@ -2735,6 +3467,12 @@ version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23fb14cb19457329c82206317a5663005a4d404783dc74f4252769b0d5f42856" +[[package]] +name = "litrs" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" + [[package]] name = "lock_api" version = "0.4.12" @@ -2751,6 +3489,15 @@ version = "0.4.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" +[[package]] +name = "malloc_buf" +version = "0.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb" +dependencies = [ + "libc", +] + [[package]] name = "matchers" version = "0.1.0" @@ -2781,6 +3528,21 @@ dependencies = [ "libc", ] +[[package]] +name = "metal" +version = "0.31.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f569fb946490b5743ad69813cb19629130ce9374034abe31614a36402d18f99e" +dependencies = [ + "bitflags 2.9.0", + "block", + "core-graphics-types", + "foreign-types 0.5.0", + "log", + "objc", + "paste", +] + [[package]] name = "mime" version = "0.3.17" @@ -2823,6 +3585,49 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "naga" +version = "24.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e380993072e52eef724eddfcde0ed013b0c023c3f0417336ed041aa9f076994e" +dependencies = [ + "arrayvec", + "bit-set 0.8.0", + "bitflags 2.9.0", + "cfg_aliases", + "codespan-reporting", + "hexf-parse", + "indexmap", + "log", + "pp-rs", + "rustc-hash", + "spirv", + "strum", + "termcolor", + "thiserror 2.0.12", + "unicode-xid", +] + +[[package]] +name = "naga_oil" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ca507a365f886f95f74420361b75442a3709c747a8a6e8b6c45b8667f45a82c" +dependencies = [ + "bit-set 0.5.3", + "codespan-reporting", + "data-encoding", + "indexmap", + "naga", + "once_cell", + "regex", + "regex-syntax 0.8.5", + "rustc-hash", + "thiserror 1.0.69", + "tracing", + "unicode-ident", +] + [[package]] name = "names" version = "0.14.0" @@ -2855,10 +3660,10 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3f42e7bbe13d351b6bead8286a43aac9534b82bd3cc43e47037f012ebfd62d4" dependencies = [ - "bitflags", + "bitflags 2.9.0", "jni-sys", "log", - "ndk-sys", + "ndk-sys 0.6.0+11769913", "num_enum", "thiserror 1.0.69", ] @@ -2869,6 +3674,15 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "27b02d87554356db9e9a873add8782d4ea6e3e58ea071a9adb9a2e8ddb884a8b" +[[package]] +name = "ndk-sys" +version = "0.5.0+25.2.9519653" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c196769dd60fd4f363e11d948139556a344e79d451aeb2fa2fd040738ef7691" +dependencies = [ + "jni-sys", +] + [[package]] name = "ndk-sys" version = "0.6.0+11769913" @@ -2884,7 +3698,7 @@ version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" dependencies = [ - "bitflags", + "bitflags 2.9.0", "cfg-if", "cfg_aliases", "libc", @@ -2968,6 +3782,15 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" +[[package]] +name = "objc" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" +dependencies = [ + "malloc_buf", +] + [[package]] name = "objc2" version = "0.6.1" @@ -2989,7 +3812,7 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "900831247d2fe1a09a683278e5384cfb8c80c79fe6b166f9d14bfdde0ea1b03c" dependencies = [ - "bitflags", + "bitflags 2.9.0", "objc2", ] @@ -3002,6 +3825,16 @@ dependencies = [ "memchr", ] +[[package]] +name = "offset-allocator" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e234d535da3521eb95106f40f0b73483d80bfb3aacf27c40d7e2b72f1a3e00a2" +dependencies = [ + "log", + "nonmax", +] + [[package]] name = "once_cell" version = "1.21.3" @@ -3017,9 +3850,9 @@ version = "0.10.72" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fedfea7d58a1f73118430a55da6a286e7b044961736ce96a16a17068ea25e5da" dependencies = [ - "bitflags", + "bitflags 2.9.0", "cfg-if", - "foreign-types", + "foreign-types 0.3.2", "libc", "once_cell", "openssl-macros", @@ -3070,6 +3903,15 @@ dependencies = [ "num-traits", ] +[[package]] +name = "ordered-float" +version = "4.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7bb71e1b3fa6ca1c61f383464aaf2bb0e2f8e772a1f01d486832464de363b951" +dependencies = [ + "num-traits", +] + [[package]] name = "overload" version = "0.1.1" @@ -3209,6 +4051,17 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +[[package]] +name = "piper" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96c8c490f422ef9a4efd2cb5b42b76c8613d7e7dfc1caf667b8a3350a5acc066" +dependencies = [ + "atomic-waker", + "fastrand", + "futures-io", +] + [[package]] name = "pkg-config" version = "0.3.32" @@ -3236,6 +4089,15 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" +[[package]] +name = "pp-rs" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb458bb7f6e250e6eb79d5026badc10a3ebb8f9a15d1fff0f13d17c71f4d6dee" +dependencies = [ + "unicode-xid", +] + [[package]] name = "ppv-lite86" version = "0.2.21" @@ -3272,6 +4134,12 @@ dependencies = [ "termtree", ] +[[package]] +name = "presser" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8cf8e6a8aa66ce33f63993ffc4ea4271eb5b0530a9002db8455ea6050c77bfa" + [[package]] name = "prettydiff" version = "0.7.0" @@ -3320,6 +4188,12 @@ dependencies = [ "parking_lot", ] +[[package]] +name = "profiling" +version = "1.0.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afbdc74edc00b6f6a218ca6a5364d6226a259d4b8ea1af4a0ea063f27e179f4d" + [[package]] name = "quote" version = "1.0.40" @@ -3335,6 +4209,12 @@ version = "5.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "74765f6d916ee2faa39bc8e68e4f3ed8949b48cccdac59983d287a7cb71ce9c5" +[[package]] +name = "radsort" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "019b4b213425016d7d84a153c4c73afb0946fbb4840e4eece7ba8848b9d6da22" + [[package]] name = "rand" version = "0.8.5" @@ -3404,19 +4284,31 @@ dependencies = [ "rand 0.8.5", ] +[[package]] +name = "range-alloc" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3d6831663a5098ea164f89cff59c6284e95f4e3c76ce9848d4529f5ccca9bde" + [[package]] name = "raw-window-handle" version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "20675572f6f24e9e76ef639bc5552774ed45f1c30e2951e1e99c59888861c539" +[[package]] +name = "rectangle-pack" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0d463f2884048e7153449a55166f91028d5b0ea53c79377099ce4e8cf0cf9bb" + [[package]] name = "redox_syscall" version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2f103c6d277498fbceb16e84d317e2a400f160f46904d5f5410848c829511a3" dependencies = [ - "bitflags", + "bitflags 2.9.0", ] [[package]] @@ -3488,13 +4380,19 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "renderdoc-sys" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b30a45b0cd0bcca8037f3d0dc3421eaf95327a17cad11964fb8179b4fc4832" + [[package]] name = "reqwest" version = "0.12.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d19c46a6fdd48bc4dab94b6103fccc55d34c67cc0ad04653aad4ea2a07cd7bbb" dependencies = [ - "base64", + "base64 0.22.1", "bytes", "futures-channel", "futures-core", @@ -3536,7 +4434,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce4d759a4729a655ddfdbb3ff6e77fb9eadd902dae12319455557796e435d2a6" dependencies = [ "ahash", - "bitflags", + "bitflags 2.9.0", "instant", "num-traits", "once_cell", @@ -3557,6 +4455,18 @@ dependencies = [ "syn", ] +[[package]] +name = "ron" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b91f7eff05f748767f183df4320a63d6936e9c6107d97c9e6bdd9784f4289c94" +dependencies = [ + "base64 0.21.7", + "bitflags 2.9.0", + "serde", + "serde_derive", +] + [[package]] name = "rustc-demangle" version = "0.1.24" @@ -3575,7 +4485,7 @@ version = "0.2.2+llvm-462a31f5a5ab" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "121e2195ff969977a4e2b5c9965ea867fce7e4cb5aee5b09dee698a7932d574f" dependencies = [ - "bitflags", + "bitflags 2.9.0", "smallvec", ] @@ -3606,7 +4516,7 @@ version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d97817398dd4bb2e6da002002db259209759911da105da92bec29ccb12cf58bf" dependencies = [ - "bitflags", + "bitflags 2.9.0", "errno", "libc", "linux-raw-sys", @@ -3694,7 +4604,7 @@ version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ - "bitflags", + "bitflags 2.9.0", "core-foundation 0.9.4", "core-foundation-sys", "libc", @@ -3720,6 +4630,12 @@ dependencies = [ "serde", ] +[[package]] +name = "send_wrapper" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73" + [[package]] name = "serde" version = "1.0.219" @@ -3746,7 +4662,7 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3a1a3341211875ef120e117ea7fd5228530ae7e7036a779fdc9117be6b3282c" dependencies = [ - "ordered-float", + "ordered-float 2.10.1", "serde", ] @@ -3890,6 +4806,15 @@ dependencies = [ "autocfg", ] +[[package]] +name = "slotmap" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbff4acf519f630b3a3ddcfaea6c06b42174d9a44bc70c620e9ed1649d58b82a" +dependencies = [ + "version_check", +] + [[package]] name = "smallvec" version = "1.15.0" @@ -3945,12 +4870,27 @@ dependencies = [ "portable-atomic", ] +[[package]] +name = "spirv" +version = "0.3.0+sdk-1.3.268.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eda41003dc44290527a59b13432d4a0379379fa074b70174882adfbdfd917844" +dependencies = [ + "bitflags 2.9.0", +] + [[package]] name = "stable_deref_trait" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" +[[package]] +name = "stackfuture" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6eae92052b72ef70dafa16eddbabffc77e5ca3574be2f7bc1127b36f0a7ad7f2" + [[package]] name = "static_assertions" version = "1.1.0" @@ -3963,6 +4903,34 @@ version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" +[[package]] +name = "strum" +version = "0.26.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" +dependencies = [ + "strum_macros", +] + +[[package]] +name = "strum_macros" +version = "0.26.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "rustversion", + "syn", +] + +[[package]] +name = "svg_fmt" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0193cc4331cfd2f3d2011ef287590868599a2f33c3e69bc22c1a3d3acf9e02fb" + [[package]] name = "syn" version = "2.0.101" @@ -4007,6 +4975,15 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "termcolor" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" +dependencies = [ + "winapi-util", +] + [[package]] name = "terminal-prompt" version = "0.2.3" @@ -4281,7 +5258,7 @@ version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "403fa3b783d4b626a8ad51d766ab03cb6d2dbfc46b1c5d4448395e6628dc9697" dependencies = [ - "bitflags", + "bitflags 2.9.0", "bytes", "futures-util", "http", @@ -4754,13 +5731,110 @@ dependencies = [ "web-sys", ] +[[package]] +name = "wgpu" +version = "24.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35904fb00ba2d2e0a4d002fcbbb6e1b89b574d272a50e5fc95f6e81cf281c245" +dependencies = [ + "arrayvec", + "bitflags 2.9.0", + "cfg_aliases", + "document-features", + "js-sys", + "log", + "naga", + "parking_lot", + "profiling", + "raw-window-handle", + "smallvec", + "static_assertions", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "wgpu-core", + "wgpu-hal", + "wgpu-types", +] + +[[package]] +name = "wgpu-core" +version = "24.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "671c25545d479b47d3f0a8e373aceb2060b67c6eb841b24ac8c32348151c7a0c" +dependencies = [ + "arrayvec", + "bit-vec 0.8.0", + "bitflags 2.9.0", + "cfg_aliases", + "document-features", + "indexmap", + "log", + "naga", + "once_cell", + "parking_lot", + "profiling", + "raw-window-handle", + "rustc-hash", + "smallvec", + "thiserror 2.0.12", + "wgpu-hal", + "wgpu-types", +] + +[[package]] +name = "wgpu-hal" +version = "24.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f112f464674ca69f3533248508ee30cb84c67cf06c25ff6800685f5e0294e259" +dependencies = [ + "android_system_properties", + "arrayvec", + "ash", + "bit-set 0.8.0", + "bitflags 2.9.0", + "block", + "bytemuck", + "cfg_aliases", + "core-graphics-types", + "glow", + "glutin_wgl_sys", + "gpu-alloc", + "gpu-allocator", + "gpu-descriptor", + "js-sys", + "khronos-egl", + "libc", + "libloading", + "log", + "metal", + "naga", + "ndk-sys 0.5.0+25.2.9519653", + "objc", + "once_cell", + "ordered-float 4.6.0", + "parking_lot", + "profiling", + "range-alloc", + "raw-window-handle", + "renderdoc-sys", + "rustc-hash", + "smallvec", + "thiserror 2.0.12", + "wasm-bindgen", + "web-sys", + "wgpu-types", + "windows", + "windows-core", +] + [[package]] name = "wgpu-types" version = "24.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "50ac044c0e76c03a0378e7786ac505d010a873665e2d51383dcff8dd227dc69c" dependencies = [ - "bitflags", + "bitflags 2.9.0", "js-sys", "log", "serde", @@ -4798,6 +5872,51 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd04d41d93c4992d421894c18c8b43496aa748dd4c081bac0dc93eb0489272b6" +dependencies = [ + "windows-core", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-core" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ba6d44ec8c2591c134257ce647b7ea6b20335bf6379a27dac5f1641fcf59f99" +dependencies = [ + "windows-implement", + "windows-interface", + "windows-result 0.2.0", + "windows-strings 0.1.0", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-implement" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bbd5b46c938e506ecbce286b6628a02171d56153ba733b6c741fc627ec9579b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-interface" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "053c4c462dc91d3b1504c6fe5a726dd15e216ba718e84a0e46a88fbe5ded3515" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "windows-link" version = "0.1.1" @@ -4810,11 +5929,20 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4286ad90ddb45071efd1a66dfa43eb02dd0dfbae1545ad6cc3c51cf34d7e8ba3" dependencies = [ - "windows-result", - "windows-strings", + "windows-result 0.3.2", + "windows-strings 0.3.1", "windows-targets 0.53.0", ] +[[package]] +name = "windows-result" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" +dependencies = [ + "windows-targets 0.52.6", +] + [[package]] name = "windows-result" version = "0.3.2" @@ -4824,6 +5952,16 @@ dependencies = [ "windows-link", ] +[[package]] +name = "windows-strings" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" +dependencies = [ + "windows-result 0.2.0", + "windows-targets 0.52.6", +] + [[package]] name = "windows-strings" version = "0.3.1" @@ -5060,7 +6198,7 @@ version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" dependencies = [ - "bitflags", + "bitflags 2.9.0", ] [[package]] @@ -5075,6 +6213,12 @@ version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" +[[package]] +name = "xml-rs" +version = "0.8.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a62ce76d9b56901b19a74f19431b0d8b3bc7ca4ad685a746dfd78ca8f4fc6bda" + [[package]] name = "yoke" version = "0.7.5" diff --git a/bevy_lint/Cargo.toml b/bevy_lint/Cargo.toml index c2b56322..1ae78b94 100644 --- a/bevy_lint/Cargo.toml +++ b/bevy_lint/Cargo.toml @@ -51,7 +51,11 @@ toml_edit = { version = "0.22.22", default-features = false, features = [ [dev-dependencies] # Used when running UI tests. -bevy = { version = "0.16.0", default-features = false, features = ["std"] } +bevy = { version = "0.16.0", default-features = false, features = [ + "std", + # used for the `camera_modification_in_fixed_update` lint + "bevy_render", +] } # Used to deserialize `--message-format=json` messages from Cargo. serde_json = "1.0.140" diff --git a/bevy_lint/src/lints/nursery/camera_modification_in_fixed_update.rs b/bevy_lint/src/lints/nursery/camera_modification_in_fixed_update.rs new file mode 100644 index 00000000..2627f202 --- /dev/null +++ b/bevy_lint/src/lints/nursery/camera_modification_in_fixed_update.rs @@ -0,0 +1,50 @@ +use clippy_utils::{sym, ty::match_type}; +use rustc_hir::{ExprKind, QPath, def::Res}; +use rustc_lint::{LateContext, LateLintPass}; +use rustc_span::Symbol; + +use crate::{declare_bevy_lint, declare_bevy_lint_pass, utils::hir_parse::MethodCall}; + +declare_bevy_lint! { + pub CAMERA_MODIFICATION_IN_FIXED_UPDATE, + super::Nursery, + "queried a zero-sized type", +} + +declare_bevy_lint_pass! { + pub CameraModificationInFixedUpdate => [CAMERA_MODIFICATION_IN_FIXED_UPDATE], + @default = { + add_systems: Symbol = sym!(add_systems), + }, +} + +impl<'tcx> LateLintPass<'tcx> for CameraModificationInFixedUpdate { + fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx rustc_hir::Expr<'tcx>) { + // Check for MethodCalls that match `App::add_systems(FIXED_UPDATE,T)` + if let Some(MethodCall { + method_path, + args, + .. + }) = MethodCall::try_from(cx, expr) + // MethodCall's identifier is `add_systems` + && method_path.ident.name == self.add_systems + //check if the first argument is the `FIXED_UPDATE` schedule + && args.first().is_some_and(|arg| { + let ty = cx.typeck_results().expr_ty(arg).peel_refs(); + match_type(cx, ty, &crate::paths::FIXED_UPDATE) + }) + { + // get the second argument + let Some(systems) = args.get(1) else { + // We should always have one or more systems + return; + }; + // TODO: handle tuples + if let ExprKind::Path(QPath::Resolved(_, path)) = systems.kind { + if let Res::Def(_, def_id) = path.res { + let ty = cx.tcx.fn_sig(def_id).skip_binder().inputs().skip_binder(); + } + } + } + } +} diff --git a/bevy_lint/src/lints/nursery/mod.rs b/bevy_lint/src/lints/nursery/mod.rs index 47279638..dd2a900f 100644 --- a/bevy_lint/src/lints/nursery/mod.rs +++ b/bevy_lint/src/lints/nursery/mod.rs @@ -6,6 +6,7 @@ use rustc_lint::{Level, Lint, LintStore}; use crate::lint::LintGroup; +pub mod camera_modification_in_fixed_update; pub mod duplicate_bevy_dependencies; pub mod zst_query; @@ -15,11 +16,17 @@ impl LintGroup for Nursery { const NAME: &str = "bevy::nursery"; const LEVEL: Level = Level::Allow; const LINTS: &[&Lint] = &[ + camera_modification_in_fixed_update::CAMERA_MODIFICATION_IN_FIXED_UPDATE, duplicate_bevy_dependencies::DUPLICATE_BEVY_DEPENDENCIES, zst_query::ZST_QUERY, ]; fn register_passes(store: &mut LintStore) { + store.register_late_pass(|_| { + Box::new( + camera_modification_in_fixed_update::CameraModificationInFixedUpdate::default(), + ) + }); // `duplicate_bevy_dependencies` is a Cargo lint, so it does not have its own pass. store.register_late_pass(|_| Box::new(zst_query::ZstQuery::default())); } diff --git a/bevy_lint/src/paths.rs b/bevy_lint/src/paths.rs index e65d28bd..31aa7936 100644 --- a/bevy_lint/src/paths.rs +++ b/bevy_lint/src/paths.rs @@ -8,6 +8,8 @@ /// pub const APP: [&str; 3] = ["bevy_app", "app", "App"]; +/// +pub const CAMERA: [&str; 3] = ["bevy_render", "camera", "Camera"]; /// pub const COMMANDS: [&str; 4] = ["bevy_ecs", "system", "commands", "Commands"]; /// @@ -26,6 +28,8 @@ pub const EVENT: [&str; 4] = ["bevy_ecs", "event", "base", "Event"]; pub const EVENTS: [&str; 4] = ["bevy_ecs", "event", "collections", "Events"]; /// pub const FILTERED_ENTITY_MUT: [&str; 4] = ["bevy_ecs", "world", "entity_ref", "FilteredEntityMut"]; +/// +pub const FIXED_UPDATE: [&str; 3] = ["bevy_app", "main_schedule", "FixedUpdate"]; /// pub const MUT: [&str; 3] = ["bevy_ecs", "change_detection", "Mut"]; /// diff --git a/bevy_lint/tests/ui/camera_modification_in_fixed_update/main.rs b/bevy_lint/tests/ui/camera_modification_in_fixed_update/main.rs new file mode 100644 index 00000000..f5b850cd --- /dev/null +++ b/bevy_lint/tests/ui/camera_modification_in_fixed_update/main.rs @@ -0,0 +1,36 @@ +#![feature(register_tool)] +#![register_tool(bevy)] +#![deny(bevy::camera_modification_in_fixed_update)] + +use bevy::prelude::*; + +fn main() { + App::new() + .add_plugins(DefaultPlugins) + .add_systems(Startup, spawn_camera) + .add_systems(FixedUpdate, move_camera) + .add_systems(FixedUpdate, (move_camera_2, move_camera_3)) + .run(); +} + +fn spawn_camera(mut commands: Commands) { + commands.spawn((Name::new("Camera"), Camera::default())); +} + +fn move_camera(mut query: Query<&mut Transform, With>) { + for mut transform in &mut query { + transform.translation.x += 1.0; + } +} + +fn move_camera_2(mut query: Query<&mut Transform, With>) { + for mut transform in &mut query { + transform.translation.x += 1.0; + } +} + +fn move_camera_3(mut query: Query<&mut Transform, With>) { + for mut transform in &mut query { + transform.translation.x += 1.0; + } +} From a71caa71db83e05ba8acb4ef6c012fb80c9fed1b Mon Sep 17 00:00:00 2001 From: DaAlbrecht Date: Sun, 18 May 2025 22:20:37 +0200 Subject: [PATCH 02/14] feat: lint none tuple systems --- bevy_lint/src/lib.rs | 1 + .../camera_modification_in_fixed_update.rs | 138 +++++++++++++++--- bevy_lint/src/paths.rs | 5 +- .../main.rs | 24 ++- .../main.stderr | 15 ++ 5 files changed, 155 insertions(+), 28 deletions(-) create mode 100644 bevy_lint/tests/ui/camera_modification_in_fixed_update/main.stderr diff --git a/bevy_lint/src/lib.rs b/bevy_lint/src/lib.rs index fb1f3f06..fd9cb0be 100644 --- a/bevy_lint/src/lib.rs +++ b/bevy_lint/src/lib.rs @@ -28,6 +28,7 @@ // This is a list of every single `rustc` crate used within this library. If you need another, add // it here! extern crate rustc_abi; +extern crate rustc_ast; extern crate rustc_data_structures; extern crate rustc_driver; extern crate rustc_errors; diff --git a/bevy_lint/src/lints/nursery/camera_modification_in_fixed_update.rs b/bevy_lint/src/lints/nursery/camera_modification_in_fixed_update.rs index 2627f202..cfcbe4f5 100644 --- a/bevy_lint/src/lints/nursery/camera_modification_in_fixed_update.rs +++ b/bevy_lint/src/lints/nursery/camera_modification_in_fixed_update.rs @@ -1,6 +1,7 @@ -use clippy_utils::{sym, ty::match_type}; +use clippy_utils::{diagnostics::span_lint_and_help, sym, ty::match_type}; use rustc_hir::{ExprKind, QPath, def::Res}; use rustc_lint::{LateContext, LateLintPass}; +use rustc_middle::ty::{Adt, GenericArgKind, TyKind}; use rustc_span::Symbol; use crate::{declare_bevy_lint, declare_bevy_lint_pass, utils::hir_parse::MethodCall}; @@ -8,7 +9,7 @@ use crate::{declare_bevy_lint, declare_bevy_lint_pass, utils::hir_parse::MethodC declare_bevy_lint! { pub CAMERA_MODIFICATION_IN_FIXED_UPDATE, super::Nursery, - "queried a zero-sized type", + "Camera modification in FixedUpdate shedule", } declare_bevy_lint_pass! { @@ -20,29 +21,120 @@ declare_bevy_lint_pass! { impl<'tcx> LateLintPass<'tcx> for CameraModificationInFixedUpdate { fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx rustc_hir::Expr<'tcx>) { - // Check for MethodCalls that match `App::add_systems(FIXED_UPDATE,T)` - if let Some(MethodCall { - method_path, - args, - .. + let Some(MethodCall { + method_path, args, .. }) = MethodCall::try_from(cx, expr) - // MethodCall's identifier is `add_systems` - && method_path.ident.name == self.add_systems - //check if the first argument is the `FIXED_UPDATE` schedule - && args.first().is_some_and(|arg| { - let ty = cx.typeck_results().expr_ty(arg).peel_refs(); - match_type(cx, ty, &crate::paths::FIXED_UPDATE) - }) + else { + return; + }; + + // Check for MethodCalls that match `App::add_systems(impl ScheduleLabel,T)` + if method_path.ident.name != self.add_systems { + return; + } + + // First argument must be the `ScheduleLabel` + let Some(first_arg) = args.first() else { + return; + }; + + let schedule_ty = cx.typeck_results().expr_ty(first_arg).peel_refs(); + + // If the system is not run during `FIXED_UPDATE` skip checking its fn_sig + if !match_type(cx, schedule_ty, &crate::paths::FIXED_UPDATE) { + return; + } + + // The system being added + let Some(system_expr) = args.get(1) else { + return; + }; + + // TODO: handle tuples (system registering, query_filter) + + // Get the function definition of this system + if let ExprKind::Path(QPath::Resolved(_, path)) = system_expr.kind + && let Res::Def(_, def_id) = path.res { - // get the second argument - let Some(systems) = args.get(1) else { - // We should always have one or more systems - return; - }; - // TODO: handle tuples - if let ExprKind::Path(QPath::Resolved(_, path)) = systems.kind { - if let Res::Def(_, def_id) = path.res { - let ty = cx.tcx.fn_sig(def_id).skip_binder().inputs().skip_binder(); + // Get the function signature of the system + let fn_sig = cx.tcx.fn_sig(def_id); + // TODO: check if there can be multiple + for ty in fn_sig.skip_binder().inputs().skip_binder() { + let Adt(adt_def_id, args) = ty.kind() else { + continue; + }; + + // check if this structure is of type `Query` + let adt_ty = cx.tcx.type_of(adt_def_id.did()).skip_binder(); + + if !match_type(cx, adt_ty, &crate::paths::QUERY) { + continue; + } + + // Get only the type arguments and ignore Lifetime arguments + let mut query_type_arguments = + args.iter() + .filter_map(|generic_arg| match generic_arg.unpack() { + GenericArgKind::Type(ty) => Some(ty), + _ => None, + }); + + // Get the generic query data type, if none is present return early. + let Some(query_data) = query_type_arguments.next() else { + return; + }; + + // TODO: idk... + let query_data_args: Vec<_> = match query_data.kind() { + TyKind::Tuple(tys) => tys + .iter() + .filter_map(|ty| match ty.kind() { + TyKind::Ref(_, _, mutability) => Some(mutability), + _ => None, + }) + .collect(), + TyKind::Adt(_, generic_args) => generic_args + .iter() + .filter_map(|arg| match arg.unpack() { + GenericArgKind::Type(ty) => match ty.kind() { + TyKind::Ref(_, _, mutability) => Some(mutability), + _ => None, + }, + _ => None, + }) + .collect(), + _ => return, + }; + + // iterate over all Filters + for query_filter in query_type_arguments { + // Check if the `With` `QueryFilter` was used. + if match_type(cx, query_filter, &crate::paths::WITH) + // Get the generic argument of the Filter + && let TyKind::Adt(_, with_args) = query_filter.kind() + // There can only be exactly one argument + && let Some(filter_commponent_arg) = with_args.iter().next() + // Get the type of the component the filter should filter for + && let GenericArgKind::Type(filter_commponent_ty) = + filter_commponent_arg.unpack() + // Check if Filter is of type `Camera` + && match_type(cx, filter_commponent_ty, &crate::paths::CAMERA) + // At this point we know, that the query_data is related to the Camera + // So we check if at least one query_data is borrowed mutably + && query_data_args.iter().any(|mutability|match mutability { + rustc_ast::Mutability::Not => false, + rustc_ast::Mutability::Mut => true, + }) + { + span_lint_and_help( + cx, + CAMERA_MODIFICATION_IN_FIXED_UPDATE, + path.span, + CAMERA_MODIFICATION_IN_FIXED_UPDATE.desc, + None, + "Put System in Update instead", + ); + } } } } diff --git a/bevy_lint/src/paths.rs b/bevy_lint/src/paths.rs index 31aa7936..e7c4379e 100644 --- a/bevy_lint/src/paths.rs +++ b/bevy_lint/src/paths.rs @@ -9,7 +9,7 @@ /// pub const APP: [&str; 3] = ["bevy_app", "app", "App"]; /// -pub const CAMERA: [&str; 3] = ["bevy_render", "camera", "Camera"]; +pub const CAMERA: [&str; 4] = ["bevy_render", "camera", "camera", "Camera"]; /// pub const COMMANDS: [&str; 4] = ["bevy_ecs", "system", "commands", "Commands"]; /// @@ -30,6 +30,9 @@ pub const EVENTS: [&str; 4] = ["bevy_ecs", "event", "collections", "Events"]; pub const FILTERED_ENTITY_MUT: [&str; 4] = ["bevy_ecs", "world", "entity_ref", "FilteredEntityMut"]; /// pub const FIXED_UPDATE: [&str; 3] = ["bevy_app", "main_schedule", "FixedUpdate"]; +/// +pub const WITH: [&str; 4] = ["bevy_ecs", "query", "filter", "With"]; + /// pub const MUT: [&str; 3] = ["bevy_ecs", "change_detection", "Mut"]; /// diff --git a/bevy_lint/tests/ui/camera_modification_in_fixed_update/main.rs b/bevy_lint/tests/ui/camera_modification_in_fixed_update/main.rs index f5b850cd..bf35525a 100644 --- a/bevy_lint/tests/ui/camera_modification_in_fixed_update/main.rs +++ b/bevy_lint/tests/ui/camera_modification_in_fixed_update/main.rs @@ -1,15 +1,25 @@ #![feature(register_tool)] #![register_tool(bevy)] #![deny(bevy::camera_modification_in_fixed_update)] +#![allow(dead_code)] use bevy::prelude::*; +#[derive(Component)] +struct Hp; + +#[derive(Component)] +struct Player; + fn main() { App::new() .add_plugins(DefaultPlugins) .add_systems(Startup, spawn_camera) - .add_systems(FixedUpdate, move_camera) - .add_systems(FixedUpdate, (move_camera_2, move_camera_3)) + // .add_systems(FixedUpdate, move_camera) + // .add_systems(FixedUpdate, move_camera_2) + .add_systems(FixedUpdate, move_camera_3) + //~^ ERROR: Camera modification in FixedUpdate shedule + //~| HELP: Put System in Update instead .run(); } @@ -29,8 +39,14 @@ fn move_camera_2(mut query: Query<&mut Transform, With>) { } } -fn move_camera_3(mut query: Query<&mut Transform, With>) { - for mut transform in &mut query { +fn move_camera_3( + mut query: Query<(&mut Transform, &Hp, Entity), With>, + mut commands: Commands, + _time: Res