From 21a84d69733da21a79128963925736c64e0c85ac Mon Sep 17 00:00:00 2001 From: Aaron Muir Hamilton Date: Sat, 2 Mar 2024 17:09:27 -0500 Subject: [PATCH 1/5] Bump vello and remove wgpu override. (#179) --- .github/workflows/ci.yml | 2 +- Cargo.lock | 186 ++++++++++++++++++++++----------------- Cargo.toml | 6 +- 3 files changed, 108 insertions(+), 86 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 96745fe6c..9b9df9593 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,7 +3,7 @@ env: # version like 1.70. Note that we only specify MAJOR.MINOR and not PATCH so that bugfixes still # come automatically. If the version specified here is no longer the latest stable version, # then please feel free to submit a PR that adjusts it along with the potential clippy fixes. - RUST_STABLE_VER: "1.74" # In quotes because otherwise 1.70 would be interpreted as 1.7 + RUST_STABLE_VER: "1.75" # In quotes because otherwise 1.70 would be interpreted as 1.7 # Rationale # diff --git a/Cargo.lock b/Cargo.lock index 1754bcc06..8c5406794 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -35,9 +35,9 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "ahash" -version = "0.8.9" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d713b3834d76b85304d4d525563c1276e2e30dc97cc67bfb4585a4a29fc2c89f" +checksum = "8b79b82693f705137f8fb9b37871d99e4f9a7df12b917eed79c3d3954830a60b" dependencies = [ "cfg-if", "getrandom", @@ -226,7 +226,7 @@ checksum = "965ab7eb5f8f97d2a083c799f3a1b994fc397b2fe2da5d1da1626ce15a39f2b1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] @@ -263,9 +263,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.86" +version = "1.0.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9fa1897e4325be0d68d48df6aa1a71ac2ed4d27723887e7754192705350730" +checksum = "02f341c093d19155a6e41631ce5971aac4e9a868262212153124c15fa22d1cdc" dependencies = [ "libc", ] @@ -433,10 +433,10 @@ checksum = "96a6ac251f4a2aca6b3f91340350eab87ae57c3f127ffeb585e92bd336717991" [[package]] name = "d3d12" version = "0.19.0" -source = "git+https://github.com/gfx-rs/wgpu.git#440574f92777c1e42a3355aa394c317645a6531b" +source = "git+https://github.com/gfx-rs/wgpu.git?rev=2d8d045453855f6594c42a6988692253da195323#2d8d045453855f6594c42a6988692253da195323" dependencies = [ "bitflags 2.4.2", - "libloading 0.8.1", + "libloading 0.8.2", "winapi", ] @@ -452,7 +452,7 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "330c60081dcc4c72131f8eb70510f1ac07223e5d4163db481a04a0befcffa412" dependencies = [ - "libloading 0.8.1", + "libloading 0.8.2", ] [[package]] @@ -470,6 +470,15 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" +[[package]] +name = "env_filter" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a009aa4810eb158359dda09d0c87378e4bbb89b5a801f016885a4707ba24f7ea" +dependencies = [ + "log", +] + [[package]] name = "env_logger" version = "0.10.2" @@ -483,6 +492,16 @@ dependencies = [ "termcolor", ] +[[package]] +name = "env_logger" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c012a26a7f605efc424dd53697843a72be7dc86ad2d01f7814337794a12231d" +dependencies = [ + "env_filter", + "log", +] + [[package]] name = "equivalent" version = "1.0.1" @@ -538,7 +557,7 @@ checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] @@ -749,7 +768,7 @@ dependencies = [ "bitflags 2.4.2", "com", "libc", - "libloading 0.8.1", + "libloading 0.8.2", "thiserror", "widestring", "winapi", @@ -757,9 +776,9 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.3.6" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd5256b483761cd23699d0da46cc6fd2ee3be420bbe6d020ae4a091e70b7e9fd" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" [[package]] name = "hexf-parse" @@ -786,9 +805,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.2.3" +version = "2.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "233cf39063f058ea2caae4091bf4a3ef70a653afbc026f5c4a4135d114e3c177" +checksum = "7b0b929d511467233429c45a44ac1dcaa21ba0f5ba11e4879e6ed28ddb4f9df4" dependencies = [ "equivalent", "hashbrown", @@ -861,7 +880,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6aae1df220ece3c0ada96b8153459b67eebe9ae9212258bb0134ae60416fdf76" dependencies = [ "libc", - "libloading 0.8.1", + "libloading 0.8.2", "pkg-config", ] @@ -915,12 +934,12 @@ dependencies = [ [[package]] name = "libloading" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c571b676ddfc9a8c12f1f3d3085a7b163966a8fd8098a90640953ce5f6170161" +checksum = "2caa5afb8bf9f3a2652760ce7d4f62d21c4d5a423e68466fca30df82f2330164" dependencies = [ "cfg-if", - "windows-sys 0.48.0", + "windows-targets 0.52.4", ] [[package]] @@ -958,9 +977,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.20" +version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" [[package]] name = "malloc_buf" @@ -1022,9 +1041,9 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.10" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" dependencies = [ "libc", "wasi", @@ -1034,7 +1053,7 @@ dependencies = [ [[package]] name = "naga" version = "0.19.0" -source = "git+https://github.com/gfx-rs/wgpu.git#440574f92777c1e42a3355aa394c317645a6531b" +source = "git+https://github.com/gfx-rs/wgpu.git?rev=2d8d045453855f6594c42a6988692253da195323#2d8d045453855f6594c42a6988692253da195323" dependencies = [ "arrayvec", "bit-set", @@ -1119,7 +1138,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] @@ -1353,9 +1372,9 @@ checksum = "42a9830a0e1b9fb145ebb365b8bc4ccd75f290f98c0247deafbbe2c75cefb544" [[package]] name = "read-fonts" -version = "0.15.5" +version = "0.15.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c044ab88c43e2eae05b34a17fc13598736679fdb03d71b49fcfe114443ec8a86" +checksum = "17ea23eedb4d938031b6d4343222444608727a6aa68ec355e13588d9947ffe92" dependencies = [ "font-types", ] @@ -1409,9 +1428,9 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "renderdoc-sys" -version = "1.0.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "216080ab382b992234dda86873c18d4c48358f5cfcb70fd693d7f6f2131b628b" +checksum = "19b30a45b0cd0bcca8037f3d0dc3421eaf95327a17cad11964fb8179b4fc4832" [[package]] name = "rustc-demangle" @@ -1495,7 +1514,7 @@ checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] @@ -1596,12 +1615,12 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.5" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" +checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" dependencies = [ "libc", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -1665,9 +1684,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.50" +version = "2.0.52" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74f1bdc9872430ce9b75da68329d1c1746faf50ffac5f19e02b71e37ff881ffb" +checksum = "b699d15b36d1f02c3e7c69f8ffef53de37aefae075d8488d4ba1a7788d574a07" dependencies = [ "proc-macro2", "quote", @@ -1698,23 +1717,23 @@ dependencies = [ [[package]] name = "test-log" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6159ab4116165c99fc88cce31f99fa2c9dbe08d3691cb38da02fc3b45f357d2b" +checksum = "7b319995299c65d522680decf80f2c108d85b861d81dfe340a10d16cee29d9e6" dependencies = [ - "env_logger", + "env_logger 0.11.2", "test-log-macros", ] [[package]] name = "test-log-macros" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ba277e77219e9eea169e8508942db1bf5d8a41ff2db9b20aab5a5aadc9fa25d" +checksum = "c8f546451eaa38373f549093fe9fd05e7d2bade739e2ddf834b9968621d60107" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] @@ -1734,7 +1753,7 @@ checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] @@ -1813,7 +1832,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] @@ -1852,7 +1871,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] @@ -1949,9 +1968,9 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "walkdir" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" dependencies = [ "same-file", "winapi-util", @@ -1984,7 +2003,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", "wasm-bindgen-shared", ] @@ -2018,7 +2037,7 @@ checksum = "642f325be6301eb8107a83d12a8ac6c1e1c54345a7ef1a9261962dfefda09e66" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -2161,7 +2180,7 @@ dependencies = [ [[package]] name = "wgpu" version = "0.19.0" -source = "git+https://github.com/gfx-rs/wgpu.git#440574f92777c1e42a3355aa394c317645a6531b" +source = "git+https://github.com/gfx-rs/wgpu.git?rev=2d8d045453855f6594c42a6988692253da195323#2d8d045453855f6594c42a6988692253da195323" dependencies = [ "arrayvec", "cfg-if", @@ -2186,7 +2205,7 @@ dependencies = [ [[package]] name = "wgpu-core" version = "0.19.0" -source = "git+https://github.com/gfx-rs/wgpu.git#440574f92777c1e42a3355aa394c317645a6531b" +source = "git+https://github.com/gfx-rs/wgpu.git?rev=2d8d045453855f6594c42a6988692253da195323#2d8d045453855f6594c42a6988692253da195323" dependencies = [ "arrayvec", "bit-vec", @@ -2212,7 +2231,7 @@ dependencies = [ [[package]] name = "wgpu-hal" version = "0.19.0" -source = "git+https://github.com/gfx-rs/wgpu.git#440574f92777c1e42a3355aa394c317645a6531b" +source = "git+https://github.com/gfx-rs/wgpu.git?rev=2d8d045453855f6594c42a6988692253da195323#2d8d045453855f6594c42a6988692253da195323" dependencies = [ "android_system_properties", "arrayvec", @@ -2232,10 +2251,11 @@ dependencies = [ "js-sys", "khronos-egl", "libc", - "libloading 0.8.1", + "libloading 0.8.2", "log", "metal", "naga", + "ndk-sys", "objc", "once_cell", "parking_lot", @@ -2255,7 +2275,7 @@ dependencies = [ [[package]] name = "wgpu-types" version = "0.19.0" -source = "git+https://github.com/gfx-rs/wgpu.git#440574f92777c1e42a3355aa394c317645a6531b" +source = "git+https://github.com/gfx-rs/wgpu.git?rev=2d8d045453855f6594c42a6988692253da195323#2d8d045453855f6594c42a6988692253da195323" dependencies = [ "bitflags 2.4.2", "js-sys", @@ -2306,7 +2326,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" dependencies = [ "windows-core", - "windows-targets 0.52.3", + "windows-targets 0.52.4", ] [[package]] @@ -2315,7 +2335,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.3", + "windows-targets 0.52.4", ] [[package]] @@ -2342,7 +2362,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.3", + "windows-targets 0.52.4", ] [[package]] @@ -2377,17 +2397,17 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.3" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d380ba1dc7187569a8a9e91ed34b8ccfc33123bbacb8c0aed2d1ad7f3ef2dc5f" +checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" dependencies = [ - "windows_aarch64_gnullvm 0.52.3", - "windows_aarch64_msvc 0.52.3", - "windows_i686_gnu 0.52.3", - "windows_i686_msvc 0.52.3", - "windows_x86_64_gnu 0.52.3", - "windows_x86_64_gnullvm 0.52.3", - "windows_x86_64_msvc 0.52.3", + "windows_aarch64_gnullvm 0.52.4", + "windows_aarch64_msvc 0.52.4", + "windows_i686_gnu 0.52.4", + "windows_i686_msvc 0.52.4", + "windows_x86_64_gnu 0.52.4", + "windows_x86_64_gnullvm 0.52.4", + "windows_x86_64_msvc 0.52.4", ] [[package]] @@ -2404,9 +2424,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.3" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68e5dcfb9413f53afd9c8f86e56a7b4d86d9a2fa26090ea2dc9e40fba56c6ec6" +checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" [[package]] name = "windows_aarch64_msvc" @@ -2422,9 +2442,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.3" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8dab469ebbc45798319e69eebf92308e541ce46760b49b18c6b3fe5e8965b30f" +checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" [[package]] name = "windows_i686_gnu" @@ -2440,9 +2460,9 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.3" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a4e9b6a7cac734a8b4138a4e1044eac3404d8326b6c0f939276560687a033fb" +checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" [[package]] name = "windows_i686_msvc" @@ -2458,9 +2478,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.3" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28b0ec9c422ca95ff34a78755cfa6ad4a51371da2a5ace67500cf7ca5f232c58" +checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" [[package]] name = "windows_x86_64_gnu" @@ -2476,9 +2496,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.3" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "704131571ba93e89d7cd43482277d6632589b18ecf4468f591fbae0a8b101614" +checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" [[package]] name = "windows_x86_64_gnullvm" @@ -2494,9 +2514,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.3" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42079295511643151e98d61c38c0acc444e52dd42ab456f7ccfd5152e8ecf21c" +checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" [[package]] name = "windows_x86_64_msvc" @@ -2512,15 +2532,15 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.3" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0770833d60a970638e989b3fa9fd2bb1aaadcf88963d1659fd7d9990196ed2d6" +checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" [[package]] name = "winit" -version = "0.29.10" +version = "0.29.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c824f11941eeae66ec71111cc2674373c772f482b58939bb4066b642aa2ffcf" +checksum = "2b9d7047a2a569d5a81e3be098dcd8153759909b127477f4397e03cf1006d90a" dependencies = [ "ahash", "android-activity", @@ -2594,7 +2614,7 @@ dependencies = [ "as-raw-xcb-connection", "gethostname", "libc", - "libloading 0.8.1", + "libloading 0.8.2", "once_cell", "rustix", "x11rb-protocol", @@ -2617,7 +2637,7 @@ name = "xilem" version = "0.1.0" dependencies = [ "bitflags 2.4.2", - "env_logger", + "env_logger 0.10.2", "fnv", "futures-task", "instant", @@ -2705,5 +2725,5 @@ checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", ] diff --git a/Cargo.toml b/Cargo.toml index fd42d30b5..4927fb97c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -50,7 +50,9 @@ taffy = ["dep:taffy"] xilem_core.workspace = true taffy = { version = "0.4.0", optional = true } vello = { git = "https://github.com/linebender/vello", rev = "6fa114c020f8656947e283bdf4bed96fe7a54c70" } -wgpu = "0.19.0" +# vello currently depends on wgpu 0.19.3, but a fix for a hang on NVIDIA Vk drivers will be postponed +# until 0.20 because it depends on a breaking change to wgpu-hal. For now this is a working revision. +wgpu = { git = "https://github.com/gfx-rs/wgpu.git", rev = "2d8d045453855f6594c42a6988692253da195323"} parley = { git = "https://github.com/dfrg/parley", rev = "1940d1ae9f2a9b44b7c18967147ffa7d345fdafd" } tokio = { version = "1.35", features = ["full"] } futures-task = "0.3" @@ -65,4 +67,4 @@ env_logger = "0.10.0" test-log = "0.2.11" [patch.crates-io] -wgpu = { git = 'https://github.com/gfx-rs/wgpu.git' } +wgpu = { git = "https://github.com/gfx-rs/wgpu.git", rev = "2d8d045453855f6594c42a6988692253da195323"} From 8f7f5db8e025f76d6da9fd0b4fe79277e05d80d7 Mon Sep 17 00:00:00 2001 From: Aaron Muir Hamilton Date: Mon, 4 Mar 2024 11:18:19 -0500 Subject: [PATCH 2/5] Reset retained click count after mouse released. (#181) --- src/widget/raw_event.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/widget/raw_event.rs b/src/widget/raw_event.rs index 1d3f36620..212d94f9f 100644 --- a/src/widget/raw_event.rs +++ b/src/widget/raw_event.rs @@ -119,7 +119,9 @@ impl PointerCrusher { self.e.wheel_delta = None; self.e.buttons.remove(&button); self.e.button = Some(button); - self.e.clone() + let r = self.e.clone(); + self.e.count = 0; + r } pub fn moved(&mut self, pos: Point) -> MouseEvent { From a0db0a4a616a1d7ffcf23db1129124d9dea5cc38 Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Sat, 9 Mar 2024 22:33:30 +0700 Subject: [PATCH 3/5] clippy: Fix semicolon_if_nothing_returned lints. (#184) --- crates/xilem_web/src/app.rs | 2 +- crates/xilem_web/src/context.rs | 6 +++--- crates/xilem_web/src/vecmap.rs | 2 +- crates/xilem_web/web_examples/todomvc/src/state.rs | 4 ++-- examples/hello.rs | 4 ++-- examples/taffy.rs | 2 +- src/geometry.rs | 2 +- src/view/taffy_layout.rs | 4 ++-- src/widget/button.rs | 2 +- src/widget/core.rs | 2 +- src/widget/piet_scene_helpers.rs | 4 ++-- src/widget/switch.rs | 2 +- 12 files changed, 18 insertions(+), 18 deletions(-) diff --git a/crates/xilem_web/src/app.rs b/crates/xilem_web/src/app.rs index 56927615d..f1fda0285 100644 --- a/crates/xilem_web/src/app.rs +++ b/crates/xilem_web/src/app.rs @@ -51,7 +51,7 @@ impl + 'static, F: FnMut(&mut T) -> V + 'static> App VecMap { } pub fn clear(&mut self) { - self.0.clear() + self.0.clear(); } /// Returns `true` if the map contains no elements. diff --git a/crates/xilem_web/web_examples/todomvc/src/state.rs b/crates/xilem_web/web_examples/todomvc/src/state.rs index 98de0952c..13d5b860f 100644 --- a/crates/xilem_web/web_examples/todomvc/src/state.rs +++ b/crates/xilem_web/web_examples/todomvc/src/state.rs @@ -75,7 +75,7 @@ impl AppState { if let Some(ref mut todo) = self.todos.iter_mut().find(|todo| todo.id == id) { todo.title_editing.clear(); todo.title_editing.push_str(&todo.title); - self.editing_id = Some(id) + self.editing_id = Some(id); } } @@ -96,7 +96,7 @@ impl AppState { /// Save the current state to local_storage pub fn save(&self) { let raw = serde_json::to_string(self).unwrap_throw(); - storage().set_item(KEY, &raw).unwrap_throw() + storage().set_item(KEY, &raw).unwrap_throw(); } } diff --git a/examples/hello.rs b/examples/hello.rs index 1de432ab6..c1c86c060 100644 --- a/examples/hello.rs +++ b/examples/hello.rs @@ -26,7 +26,7 @@ fn app_logic(data: &mut AppData) -> impl View { data.count = 0; }), switch(data.is_on, |data: &mut AppData, value: bool| { - data.is_on = value + data.is_on = value; }), )), )) @@ -55,5 +55,5 @@ fn main() { }; let app = App::new(data, app_logic); - AppLauncher::new(app).run() + AppLauncher::new(app).run(); } diff --git a/examples/taffy.rs b/examples/taffy.rs index c58791158..de9e672b2 100644 --- a/examples/taffy.rs +++ b/examples/taffy.rs @@ -126,5 +126,5 @@ fn app_logic(state: &mut AppState) -> impl View { fn main() { let app = App::new(AppState::new(), app_logic); - AppLauncher::new(app).run() + AppLauncher::new(app).run(); } diff --git a/src/geometry.rs b/src/geometry.rs index 5d49b4525..7fa12da81 100644 --- a/src/geometry.rs +++ b/src/geometry.rs @@ -62,7 +62,7 @@ impl Axis { /// Updates the scalar of value on the orthogonal axis. pub fn set_minor(self, value: &mut T, major: T::Scalar) { - self.cross().set_major(value, major) + self.cross().set_major(value, major); } /// Maps the scalar of the value on this axis. diff --git a/src/view/taffy_layout.rs b/src/view/taffy_layout.rs index 1b8e67f4a..b7f6d472b 100644 --- a/src/view/taffy_layout.rs +++ b/src/view/taffy_layout.rs @@ -127,7 +127,7 @@ impl> View for TaffyLayout { if self.background_color != prev.background_color { element.background_color = self.background_color; - flags |= ChangeFlags::PAINT + flags |= ChangeFlags::PAINT; } if self.style != prev.style { @@ -137,7 +137,7 @@ impl> View for TaffyLayout { // Clear layout cache if the layout ChangeFlag is set if flags.contains(ChangeFlags::LAYOUT) || flags.contains(ChangeFlags::TREE) { - element.cache.clear() + element.cache.clear(); } flags diff --git a/src/widget/button.rs b/src/widget/button.rs index b19c8bd9e..c05081147 100644 --- a/src/widget/button.rs +++ b/src/widget/button.rs @@ -72,7 +72,7 @@ impl Widget for Button { fn lifecycle(&mut self, cx: &mut LifeCycleCx, event: &LifeCycle) { if let LifeCycle::HotChanged(_) = event { - cx.request_paint() + cx.request_paint(); } } diff --git a/src/widget/core.rs b/src/widget/core.rs index c4e0fbc36..19f348030 100644 --- a/src/widget/core.rs +++ b/src/widget/core.rs @@ -149,7 +149,7 @@ impl WidgetState { } fn request(&mut self, flags: PodFlags) { - self.flags |= flags + self.flags |= flags; } } diff --git a/src/widget/piet_scene_helpers.rs b/src/widget/piet_scene_helpers.rs index bdda53a5a..aecacf4ba 100644 --- a/src/widget/piet_scene_helpers.rs +++ b/src/widget/piet_scene_helpers.rs @@ -22,7 +22,7 @@ pub fn stroke<'b>( brush, None, path, - ) + ); } // Note: copied from piet @@ -77,5 +77,5 @@ pub fn fill_lin_gradient( } pub fn fill_color(scene: &mut Scene, path: &impl Shape, color: Color) { - scene.fill(Fill::NonZero, Affine::IDENTITY, color, None, path) + scene.fill(Fill::NonZero, Affine::IDENTITY, color, None, path); } diff --git a/src/widget/switch.rs b/src/widget/switch.rs index 21a080706..33edd8762 100644 --- a/src/widget/switch.rs +++ b/src/widget/switch.rs @@ -74,7 +74,7 @@ impl Widget for Switch { Event::MouseUp(_) => { if self.is_dragging { if self.is_on != (self.knob_position.x > SWITCH_WIDTH / 2.0) { - cx.add_message(Message::new(self.id_path.clone(), ())) + cx.add_message(Message::new(self.id_path.clone(), ())); } } else if cx.is_active() { cx.add_message(Message::new(self.id_path.clone(), ())); From fbe553f9de161c8129b8667761a6f4e03050ab4d Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Sat, 9 Mar 2024 23:26:02 +0700 Subject: [PATCH 4/5] clippy: Configure via `lints` table in `Cargo.toml` (#185) As of Rust 1.74, lints can be configured within the `Cargo.toml` which allows us to not have to configure them in the source code as well as simplifying having a single configuration across an entire workspace. This is documented at: https://doc.rust-lang.org/nightly/cargo/reference/manifest.html#the-lints-section --- Cargo.toml | 6 ++++++ crates/xilem_core/Cargo.toml | 3 +++ crates/xilem_web/Cargo.toml | 3 +++ crates/xilem_web/web_examples/counter/Cargo.toml | 3 +++ .../web_examples/counter_custom_element/Cargo.toml | 3 +++ crates/xilem_web/web_examples/mathml_svg/Cargo.toml | 3 +++ crates/xilem_web/web_examples/svgtoy/Cargo.toml | 3 +++ crates/xilem_web/web_examples/todomvc/Cargo.toml | 3 +++ 8 files changed, 27 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 4927fb97c..2039d2571 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,6 +19,9 @@ license = "Apache-2.0" xilem_core = { version = "0.1.0", path = "crates/xilem_core" } kurbo = "0.11.0" +[workspace.lints] +clippy.semicolon_if_nothing_returned = "warn" + [package] name = "xilem" version = "0.1.0" @@ -39,6 +42,9 @@ default-target = "x86_64-pc-windows-msvc" # rustdoc-scrape-examples tracking issue https://github.com/rust-lang/rust/issues/88791 cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"] +[lints] +workspace = true + [features] default = ["x11", "taffy"] diff --git a/crates/xilem_core/Cargo.toml b/crates/xilem_core/Cargo.toml index a44643da5..b2d9c7256 100644 --- a/crates/xilem_core/Cargo.toml +++ b/crates/xilem_core/Cargo.toml @@ -17,4 +17,7 @@ default-target = "x86_64-pc-windows-msvc" # rustdoc-scrape-examples tracking issue https://github.com/rust-lang/rust/issues/88791 cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"] +[lints] +workspace = true + [dependencies] diff --git a/crates/xilem_web/Cargo.toml b/crates/xilem_web/Cargo.toml index 18fb95ee1..43d04e426 100644 --- a/crates/xilem_web/Cargo.toml +++ b/crates/xilem_web/Cargo.toml @@ -17,6 +17,9 @@ default-target = "x86_64-pc-windows-msvc" # rustdoc-scrape-examples tracking issue https://github.com/rust-lang/rust/issues/88791 cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"] +[lints] +workspace = true + [dependencies] xilem_core.workspace = true kurbo.workspace = true diff --git a/crates/xilem_web/web_examples/counter/Cargo.toml b/crates/xilem_web/web_examples/counter/Cargo.toml index ccd520cf9..0db723c23 100644 --- a/crates/xilem_web/web_examples/counter/Cargo.toml +++ b/crates/xilem_web/web_examples/counter/Cargo.toml @@ -5,6 +5,9 @@ publish = false license.workspace = true edition.workspace = true +[lints] +workspace = true + [dependencies] console_error_panic_hook = "0.1" wasm-bindgen = "0.2.87" diff --git a/crates/xilem_web/web_examples/counter_custom_element/Cargo.toml b/crates/xilem_web/web_examples/counter_custom_element/Cargo.toml index 4a1179f00..c718f594f 100644 --- a/crates/xilem_web/web_examples/counter_custom_element/Cargo.toml +++ b/crates/xilem_web/web_examples/counter_custom_element/Cargo.toml @@ -5,6 +5,9 @@ publish = false license.workspace = true edition.workspace = true +[lints] +workspace = true + [dependencies] console_error_panic_hook = "0.1" wasm-bindgen = "0.2.87" diff --git a/crates/xilem_web/web_examples/mathml_svg/Cargo.toml b/crates/xilem_web/web_examples/mathml_svg/Cargo.toml index 195a9ca79..529b27905 100644 --- a/crates/xilem_web/web_examples/mathml_svg/Cargo.toml +++ b/crates/xilem_web/web_examples/mathml_svg/Cargo.toml @@ -5,6 +5,9 @@ publish = false license.workspace = true edition.workspace = true +[lints] +workspace = true + [dependencies] console_error_panic_hook = "0.1" wasm-bindgen = "0.2.87" diff --git a/crates/xilem_web/web_examples/svgtoy/Cargo.toml b/crates/xilem_web/web_examples/svgtoy/Cargo.toml index 0f0dc259e..8f9f41cc5 100644 --- a/crates/xilem_web/web_examples/svgtoy/Cargo.toml +++ b/crates/xilem_web/web_examples/svgtoy/Cargo.toml @@ -5,6 +5,9 @@ publish = false license.workspace = true edition.workspace = true +[lints] +workspace = true + [dependencies] console_error_panic_hook = "0.1" wasm-bindgen = "0.2.87" diff --git a/crates/xilem_web/web_examples/todomvc/Cargo.toml b/crates/xilem_web/web_examples/todomvc/Cargo.toml index 7aa04c4b0..7e33d8dc5 100644 --- a/crates/xilem_web/web_examples/todomvc/Cargo.toml +++ b/crates/xilem_web/web_examples/todomvc/Cargo.toml @@ -5,6 +5,9 @@ publish = false license.workspace = true edition.workspace = true +[lints] +workspace = true + [dependencies] console_error_panic_hook = "0.1.7" serde = { version = "1.0.170", features = ["derive"] } From 50d51fad014b421bb16dbbc2b9bf29cd78990ec6 Mon Sep 17 00:00:00 2001 From: Philipp Mildenberger Date: Mon, 11 Mar 2024 11:24:48 +0100 Subject: [PATCH 5/5] Fix peek in `VecSplice` (#187) * Fix peek in `VecSplice` * Rename `peek(_mut)` to `last_mutated(_mut)` in `VecSplice` and fixed index access --- crates/xilem_core/src/sequence.rs | 2 +- crates/xilem_core/src/vec_splice.rs | 16 ++++++++++++---- crates/xilem_web/src/elements.rs | 2 +- src/view/tree_structure_tracking.rs | 2 +- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/crates/xilem_core/src/sequence.rs b/crates/xilem_core/src/sequence.rs index 622cb3dce..b2e2560ec 100644 --- a/crates/xilem_core/src/sequence.rs +++ b/crates/xilem_core/src/sequence.rs @@ -91,7 +91,7 @@ macro_rules! generate_viewsequence_trait { fn mark(&mut self, changeflags: $changeflags, _cx: &mut $cx) -> $changeflags { - self.peek_mut().map(|pod| pod.mark(changeflags)).unwrap_or_default() + self.last_mutated_mut().map(|pod| pod.mark(changeflags)).unwrap_or_default() } fn delete(&mut self, n: usize, _cx: &mut $cx) { diff --git a/crates/xilem_core/src/vec_splice.rs b/crates/xilem_core/src/vec_splice.rs index b460744fe..e438d7615 100644 --- a/crates/xilem_core/src/vec_splice.rs +++ b/crates/xilem_core/src/vec_splice.rs @@ -50,12 +50,20 @@ impl<'a, 'b, T> VecSplice<'a, 'b, T> { &mut self.v[ix] } - pub fn peek(&self) -> Option<&T> { - self.v.last() + pub fn last_mutated(&self) -> Option<&T> { + if self.ix == 0 { + None + } else { + self.v.get(self.ix - 1) + } } - pub fn peek_mut(&mut self) -> Option<&mut T> { - self.v.last_mut() + pub fn last_mutated_mut(&mut self) -> Option<&mut T> { + if self.ix == 0 { + None + } else { + self.v.get_mut(self.ix - 1) + } } pub fn len(&self) -> usize { diff --git a/crates/xilem_web/src/elements.rs b/crates/xilem_web/src/elements.rs index 10111bb97..1a48bf596 100644 --- a/crates/xilem_web/src/elements.rs +++ b/crates/xilem_web/src/elements.rs @@ -123,7 +123,7 @@ impl<'a, 'b, 'c> ElementsSplice for ChildrenSplice<'a, 'b, 'c> { self.node_list = Some(self.parent.child_nodes()); self.node_list.as_ref().unwrap() }; - let cur_child = self.children.peek_mut().unwrap_throw(); + let cur_child = self.children.last_mutated_mut().unwrap_throw(); let old_child = node_list.get(self.child_idx).unwrap_throw(); self.parent .replace_child(cur_child.0.as_node_ref(), &old_child) diff --git a/src/view/tree_structure_tracking.rs b/src/view/tree_structure_tracking.rs index a05ada475..aa5c797cd 100644 --- a/src/view/tree_structure_tracking.rs +++ b/src/view/tree_structure_tracking.rs @@ -38,7 +38,7 @@ impl<'a, 'b> ElementsSplice for TreeStructureSplice<'a, 'b> { fn mark(&mut self, changeflags: ChangeFlags, cx: &mut Cx) -> ChangeFlags { if changeflags.contains(ChangeFlags::tree_structure()) { let current_id = self.current_child_id.take().unwrap(); - let new_id = self.splice.peek().unwrap().id(); + let new_id = self.splice.last_mutated().unwrap().id(); if current_id != new_id { cx.tree_structure .change_child(cx.element_id(), self.splice.len() - 1, new_id);