From 6f820d6d99b2cdd5e381e7c060c480fd0117040a Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Sat, 23 Mar 2024 20:57:42 -0700 Subject: [PATCH 01/18] Release 1.10.0 --- Cargo.toml | 2 +- RELEASES.md | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 8c1fed39d..761c03ce1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rayon" -version = "1.9.0" +version = "1.10.0" authors = ["Niko Matsakis ", "Josh Stone "] description = "Simple work-stealing parallelism for Rust" diff --git a/RELEASES.md b/RELEASES.md index 4c2e152f9..682ebb42d 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1,3 +1,9 @@ +# Release rayon 1.10.0 (2024-03-23) + +- The new methods `ParallelSlice::par_chunk_by` and + `ParallelSliceMut::par_chunk_by_mut` work like the slice methods `chunk_by` + and `chunk_by_mut` added in Rust 1.77. + # Release rayon 1.9.0 (2024-02-27) - The new methods `IndexedParallelIterator::by_exponential_blocks` and From e7333eb255e067307fe7be913aca897e9a860539 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Sat, 23 Mar 2024 20:58:43 -0700 Subject: [PATCH 02/18] bump ci/compat-Cargo.lock --- ci/compat-Cargo.lock | 221 +++++++++++++++++++++++-------------------- 1 file changed, 119 insertions(+), 102 deletions(-) diff --git a/ci/compat-Cargo.lock b/ci/compat-Cargo.lock index 7c3432683..3c9f6e6c5 100644 --- a/ci/compat-Cargo.lock +++ b/ci/compat-Cargo.lock @@ -35,9 +35,9 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "ahash" -version = "0.8.10" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b79b82693f705137f8fb9b37871d99e4f9a7df12b917eed79c3d3954830a60b" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ "cfg-if", "getrandom", @@ -48,9 +48,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] @@ -62,7 +62,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ee91c0c2905bae44f84bfa4e044536541df26b7703fd0888deeb9060fcc44289" dependencies = [ "android-properties", - "bitflags 2.4.2", + "bitflags 2.5.0", "cc", "cesu8", "jni", @@ -123,9 +123,9 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "backtrace" -version = "0.3.69" +version = "0.3.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" dependencies = [ "addr2line", "cc", @@ -144,9 +144,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.2" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" [[package]] name = "block-sys" @@ -169,21 +169,21 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.15.3" +version = "3.15.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ea184aa71bb362a1157c896979544cc23974e08fd265f29ea96b59f0b4a555b" +checksum = "7ff69b9dd49fd426c69a0db9fc04dd934cdb6645ff000864d98f7e2af8830eaa" [[package]] name = "bytemuck" -version = "1.14.3" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2ef034f05691a48569bd920a96c81b9d91bbad1ab5ac7c4616c1f6ef36cb79f" +checksum = "5d6d68c57235a3a081186990eca2867354726650f42f7516ca50c28d6281fd15" [[package]] name = "bytes" -version = "1.5.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" +checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" [[package]] name = "calloop" @@ -191,7 +191,7 @@ version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fba7adb4dd5aa98e5553510223000e7148f621165ec5f9acd7113f6ca4995298" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", "log", "polling", "rustix", @@ -213,10 +213,11 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.88" +version = "1.0.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02f341c093d19155a6e41631ce5971aac4e9a868262212153124c15fa22d1cdc" +checksum = "8cd6604a82acf3039f1144f54b8eb34e91ffba622051189e71b781822d5ee1f5" dependencies = [ + "jobserver", "libc", ] @@ -410,9 +411,9 @@ dependencies = [ [[package]] name = "fixedbitset" -version = "0.5.0" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b51ee430d5ff16df7998870eb0b4775383ac5bc450f5a2ed547394fe2d617131" +checksum = "a1a73ce1c73b7c2bae1da2d2881eadd020bafb406731036ad248e8a7c2df392c" [[package]] name = "fnv" @@ -510,7 +511,7 @@ version = "0.31.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "18fcd4ae4e86d991ad1300b8f57166e5be0c95ef1f63f3f5b827f8a164548746" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", "cfg_aliases", "cgl", "core-foundation", @@ -575,6 +576,12 @@ version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +[[package]] +name = "hermit-abi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" + [[package]] name = "icrate" version = "0.0.4" @@ -588,9 +595,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.2.3" +version = "2.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "233cf39063f058ea2caae4091bf4a3ef70a653afbc026f5c4a4135d114e3c177" +checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ "equivalent", "hashbrown", @@ -618,11 +625,20 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" +[[package]] +name = "jobserver" +version = "0.1.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab46a6e9526ddef3ae7f787c06f0f2600639ba80ea3eade3d8e670a2230f51d6" +dependencies = [ + "libc", +] + [[package]] name = "js-sys" -version = "0.3.68" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "406cda4b368d531c842222cf9d2600a9a4acce8d29423695379c6868a143a9ee" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" dependencies = [ "wasm-bindgen", ] @@ -647,12 +663,12 @@ checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" [[package]] name = "libloading" -version = "0.8.1" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c571b676ddfc9a8c12f1f3d3085a7b163966a8fd8098a90640953ce5f6170161" +checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19" dependencies = [ "cfg-if", - "windows-sys 0.48.0", + "windows-targets 0.52.4", ] [[package]] @@ -661,7 +677,7 @@ version = "0.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3af92c55d7d839293953fcd0fda5ecfe93297cfde6ffbdec13b41d99c0ba6607" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", "libc", "redox_syscall 0.4.1", ] @@ -674,9 +690,9 @@ checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" [[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 = "memchr" @@ -717,7 +733,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2076a31b7010b17a38c01907c45b945e8f11495ee4dd588309718901b1f7a5b7" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", "jni-sys", "log", "ndk-sys", @@ -913,12 +929,13 @@ checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" [[package]] name = "polling" -version = "3.5.0" +version = "3.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24f040dee2588b4963afb4e420540439d126f73fdacf4a9c486a96d840bac3c9" +checksum = "e0c976a60b2d7e99d6f229e414670a9b85d13ac305cc6d1e9c134de58c5aaaf6" dependencies = [ "cfg-if", "concurrent-queue", + "hermit-abi", "pin-project-lite", "rustix", "tracing", @@ -942,9 +959,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.78" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" +checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e" dependencies = [ "unicode-ident", ] @@ -1020,7 +1037,7 @@ checksum = "42a9830a0e1b9fb145ebb365b8bc4ccd75f290f98c0247deafbbe2c75cefb544" [[package]] name = "rayon" -version = "1.9.0" +version = "1.10.0" dependencies = [ "either", "rand", @@ -1083,9 +1100,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.3" +version = "1.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" +checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" dependencies = [ "aho-corasick", "memchr", @@ -1095,9 +1112,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" +checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" dependencies = [ "aho-corasick", "memchr", @@ -1118,11 +1135,11 @@ checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" [[package]] name = "rustix" -version = "0.38.31" +version = "0.38.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949" +checksum = "65e04861e65f21776e67888bfbea442b3642beaa0138fdb1dd7a84a52dffdb89" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", "errno", "libc", "linux-raw-sys", @@ -1188,9 +1205,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.13.1" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "smithay-client-toolkit" @@ -1198,7 +1215,7 @@ version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "922fd3eeab3bd820d76537ce8f582b1cf951eceb5475c28500c7457d9d17f53a" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", "calloop", "calloop-wayland-source", "cursor-icon", @@ -1240,9 +1257,9 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "syn" -version = "2.0.51" +version = "2.0.55" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ab617d94515e94ae53b8406c628598680aa0c9587474ecbe58188f7b345d66c" +checksum = "002a1b3dbf967edfafc32655d0f377ab0bb7b994aa1d32c8cc7e9b8bf3ebb8f0" dependencies = [ "proc-macro2", "quote", @@ -1257,18 +1274,18 @@ checksum = "36ae8932fcfea38b7d3883ae2ab357b0d57a02caaa18ebb4f5ece08beaec4aa0" [[package]] name = "thiserror" -version = "1.0.57" +version = "1.0.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e45bcbe8ed29775f228095caf2cd67af7a4ccf756ebff23a306bf3e8b47b24b" +checksum = "03468839009160513471e86a034bb2c5c0e4baae3b43f79ffc55c4a5427b3297" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.57" +version = "1.0.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" +checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7" dependencies = [ "proc-macro2", "quote", @@ -1359,9 +1376,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", @@ -1375,9 +1392,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.91" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1e124130aee3fb58c5bdd6b639a0509486b0338acaaae0c84a5124b0f588b7f" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -1385,9 +1402,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.91" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9e7e1900c352b609c8488ad12639a311045f40a35491fb69ba8c12f758af70b" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" dependencies = [ "bumpalo", "log", @@ -1400,9 +1417,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.41" +version = "0.4.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "877b9c3f61ceea0e56331985743b13f3d25c406a7098d45180fb5f09bc19ed97" +checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" dependencies = [ "cfg-if", "js-sys", @@ -1412,9 +1429,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.91" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b30af9e2d358182b5c7449424f017eba305ed32a7010509ede96cdc4696c46ed" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1422,9 +1439,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.91" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "642f325be6301eb8107a83d12a8ac6c1e1c54345a7ef1a9261962dfefda09e66" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", @@ -1435,9 +1452,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.91" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f186bd2dcf04330886ce82d6f33dd75a7bfcf69ecf5763b89fcde53b6ac9838" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "wasm_sync" @@ -1470,7 +1487,7 @@ version = "0.31.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "82fb96ee935c2cea6668ccb470fb7771f6215d1691746c2d896b447a00ad3f1f" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", "rustix", "wayland-backend", "wayland-scanner", @@ -1482,7 +1499,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "625c5029dbd43d25e6aa9615e88b829a5cad13b2819c4ae129fdbb7c31ab4c7e" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", "cursor-icon", "wayland-backend", ] @@ -1504,7 +1521,7 @@ version = "0.31.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f81f365b8b4a97f422ac0e8737c438024b5951734506b0e1d775c73030561f4" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", "wayland-backend", "wayland-client", "wayland-scanner", @@ -1516,7 +1533,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23803551115ff9ea9bce586860c5c5a971e360825a0309264102a9495a5ff479" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", "wayland-backend", "wayland-client", "wayland-protocols", @@ -1529,7 +1546,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ad1f61b76b6c2d8742e10f9ba5c3737f6530b4c243132c2a2ccc8aa96fe25cd6" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", "wayland-backend", "wayland-client", "wayland-protocols", @@ -1561,9 +1578,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.68" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96565907687f7aceb35bc5fc03770a8a0471d82e479f25832f54a0e3f4b28446" +checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" dependencies = [ "js-sys", "wasm-bindgen", @@ -1634,7 +1651,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]] @@ -1669,17 +1686,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]] @@ -1696,9 +1713,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" @@ -1714,9 +1731,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" @@ -1732,9 +1749,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" @@ -1750,9 +1767,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" @@ -1768,9 +1785,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" @@ -1786,9 +1803,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" @@ -1804,20 +1821,20 @@ 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.11" +version = "0.29.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "272be407f804517512fdf408f0fe6c067bf24659a913c61af97af176bfd5aa92" +checksum = "0d59ad965a635657faf09c8f062badd885748428933dad8e8bdd64064d92e5ca" dependencies = [ "ahash", "android-activity", "atomic-waker", - "bitflags 2.4.2", + "bitflags 2.5.0", "bytemuck", "calloop", "cfg_aliases", @@ -1910,7 +1927,7 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d039de8032a9a8856a6be89cea3e5d12fdd82306ab7c94d74e6deab2460651c5" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", "dlib", "log", "once_cell", From a14f4591478c1ac73fd0a07492870d6898f6552d Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Sat, 23 Mar 2024 21:00:13 -0700 Subject: [PATCH 03/18] Allow clippy::type_complexity --- rayon-core/src/scope/mod.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/rayon-core/src/scope/mod.rs b/rayon-core/src/scope/mod.rs index 76f6cb878..1d8732fea 100644 --- a/rayon-core/src/scope/mod.rs +++ b/rayon-core/src/scope/mod.rs @@ -55,6 +55,7 @@ struct ScopeBase<'scope> { /// all of which outlive `'scope`. They're not actually required to be /// `Sync`, but it's still safe to let the `Scope` implement `Sync` because /// the closures are only *moved* across threads to be executed. + #[allow(clippy::type_complexity)] marker: PhantomData) + Send + Sync + 'scope>>, } From f3dbb4283223ca006e4d501a9f4f995939310a50 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Sat, 23 Mar 2024 21:11:32 -0700 Subject: [PATCH 04/18] Use prelude `Ord::min`/`max` instead of from `cmp` --- rayon-core/src/scope/test.rs | 3 +-- rayon-core/src/sleep/counters.rs | 2 +- rayon-core/src/sleep/mod.rs | 4 ++-- rayon-demo/src/mergesort/mod.rs | 3 +-- rayon-demo/src/tsp/step.rs | 3 +-- src/iter/chain.rs | 5 ++--- src/iter/chunks.rs | 4 +--- src/iter/interleave.rs | 5 ++--- src/iter/len.rs | 5 ++--- src/iter/mod.rs | 10 +++++----- src/iter/plumbing/mod.rs | 7 +++---- src/iter/skip.rs | 3 +-- src/iter/step_by.rs | 4 +--- src/iter/take.rs | 3 +-- src/iter/test.rs | 4 ++-- src/iter/zip.rs | 7 +++---- src/slice/chunks.rs | 5 ++--- src/slice/mod.rs | 4 ++-- src/slice/quicksort.rs | 7 +++---- tests/sort-panic-safe.rs | 4 ++-- 20 files changed, 38 insertions(+), 54 deletions(-) diff --git a/rayon-core/src/scope/test.rs b/rayon-core/src/scope/test.rs index ad8c4af0b..bfec35382 100644 --- a/rayon-core/src/scope/test.rs +++ b/rayon-core/src/scope/test.rs @@ -3,7 +3,6 @@ use crate::ThreadPoolBuilder; use crate::{scope, scope_fifo, Scope, ScopeFifo}; use rand::{Rng, SeedableRng}; use rand_xorshift::XorShiftRng; -use std::cmp; use std::iter::once; use std::sync::atomic::{AtomicUsize, Ordering}; use std::sync::{Barrier, Mutex}; @@ -182,7 +181,7 @@ fn the_final_countdown<'scope>( let diff = if p > q { p - q } else { q - p }; let mut data = max.lock().unwrap(); - *data = cmp::max(diff, *data); + *data = Ord::max(diff, *data); if n > 0 { s.spawn(move |s| the_final_countdown(s, bottom_of_stack, max, n - 1)); diff --git a/rayon-core/src/sleep/counters.rs b/rayon-core/src/sleep/counters.rs index 53d2c5527..96db5dca2 100644 --- a/rayon-core/src/sleep/counters.rs +++ b/rayon-core/src/sleep/counters.rs @@ -166,7 +166,7 @@ impl AtomicCounters { // Current heuristic: whenever an inactive thread goes away, if // there are any sleeping threads, wake 'em up. let sleeping_threads = old_value.sleeping_threads(); - std::cmp::min(sleeping_threads, 2) + Ord::min(sleeping_threads, 2) } /// Subtracts a sleeping thread. This cannot fail, but it is only diff --git a/rayon-core/src/sleep/mod.rs b/rayon-core/src/sleep/mod.rs index fa1f7beed..acef9bf64 100644 --- a/rayon-core/src/sleep/mod.rs +++ b/rayon-core/src/sleep/mod.rs @@ -264,10 +264,10 @@ impl Sleep { // -- clearly the existing idle jobs aren't enough. Otherwise, // check to see if we have enough idle workers. if !queue_was_empty { - let num_to_wake = std::cmp::min(num_jobs, num_sleepers); + let num_to_wake = Ord::min(num_jobs, num_sleepers); self.wake_any_threads(num_to_wake); } else if num_awake_but_idle < num_jobs { - let num_to_wake = std::cmp::min(num_jobs - num_awake_but_idle, num_sleepers); + let num_to_wake = Ord::min(num_jobs - num_awake_but_idle, num_sleepers); self.wake_any_threads(num_to_wake); } } diff --git a/rayon-demo/src/mergesort/mod.rs b/rayon-demo/src/mergesort/mod.rs index a60ce32d5..02a82c8a0 100644 --- a/rayon-demo/src/mergesort/mod.rs +++ b/rayon-demo/src/mergesort/mod.rs @@ -26,7 +26,6 @@ pub struct Args { use docopt::Docopt; -use std::cmp::max; use std::mem::MaybeUninit; use std::slice; use std::time::Instant; @@ -132,7 +131,7 @@ fn seq_merge(a: &[T], b: &[T], dest: &mut [MaybeUninit]) { dest.copy_from_slice(as_uninit_slice(a)); return; } - let biggest = max(*a.last().unwrap(), *b.last().unwrap()); + let biggest = Ord::max(*a.last().unwrap(), *b.last().unwrap()); let mut ai = a.iter(); let mut an = *ai.next().unwrap(); let mut bi = b.iter(); diff --git a/rayon-demo/src/tsp/step.rs b/rayon-demo/src/tsp/step.rs index d038ae6d3..568a00e57 100644 --- a/rayon-demo/src/tsp/step.rs +++ b/rayon-demo/src/tsp/step.rs @@ -1,5 +1,4 @@ use rayon::Scope; -use std::cmp; use std::sync::Arc; use super::graph::{Graph, Node, NodeSet}; @@ -90,7 +89,7 @@ fn compute_lower_bound( // track the cheapest way to reach node `j` that doesn't // start from one of the nodes we've been to already (but // maybe starts from the most recent node): - min_weights[j.index()] = cmp::min(w, min_weights[j.index()]); + min_weights[j.index()] = Ord::min(w, min_weights[j.index()]); } } } diff --git a/src/iter/chain.rs b/src/iter/chain.rs index 48fce07ed..25ee788c1 100644 --- a/src/iter/chain.rs +++ b/src/iter/chain.rs @@ -1,7 +1,6 @@ use super::plumbing::*; use super::*; use rayon_core::join; -use std::cmp; use std::iter; /// `Chain` is an iterator that joins `b` after `a` in one continuous iterator. @@ -178,11 +177,11 @@ where } fn min_len(&self) -> usize { - cmp::max(self.a.min_len(), self.b.min_len()) + Ord::max(self.a.min_len(), self.b.min_len()) } fn max_len(&self) -> usize { - cmp::min(self.a.max_len(), self.b.max_len()) + Ord::min(self.a.max_len(), self.b.max_len()) } fn split_at(self, index: usize) -> (Self, Self) { diff --git a/src/iter/chunks.rs b/src/iter/chunks.rs index ec48278d0..55f2ea87e 100644 --- a/src/iter/chunks.rs +++ b/src/iter/chunks.rs @@ -1,5 +1,3 @@ -use std::cmp::min; - use super::plumbing::*; use super::*; use crate::math::div_round_up; @@ -133,7 +131,7 @@ where } fn split_at(self, index: usize) -> (Self, Self) { - let elem_index = min(index * self.chunk_size, self.len); + let elem_index = Ord::min(index * self.chunk_size, self.len); let (left, right) = self.base.split_at(elem_index); ( ChunkProducer { diff --git a/src/iter/interleave.rs b/src/iter/interleave.rs index 3cacc49f9..f88d31e1d 100644 --- a/src/iter/interleave.rs +++ b/src/iter/interleave.rs @@ -1,6 +1,5 @@ use super::plumbing::*; use super::*; -use std::cmp; use std::iter::Fuse; /// `Interleave` is an iterator that interleaves elements of iterators @@ -185,11 +184,11 @@ where } fn min_len(&self) -> usize { - cmp::max(self.i.min_len(), self.j.min_len()) + Ord::max(self.i.min_len(), self.j.min_len()) } fn max_len(&self) -> usize { - cmp::min(self.i.max_len(), self.j.max_len()) + Ord::min(self.i.max_len(), self.j.max_len()) } /// We know 0 < index <= self.i_len + self.j_len diff --git a/src/iter/len.rs b/src/iter/len.rs index 8ec7f33a1..ba3cca8ba 100644 --- a/src/iter/len.rs +++ b/src/iter/len.rs @@ -1,6 +1,5 @@ use super::plumbing::*; use super::*; -use std::cmp; /// `MinLen` is an iterator that imposes a minimum length on iterator splits. /// This struct is created by the [`with_min_len()`] method on [`IndexedParallelIterator`] @@ -107,7 +106,7 @@ where } fn min_len(&self) -> usize { - cmp::max(self.min, self.base.min_len()) + Ord::max(self.min, self.base.min_len()) } fn max_len(&self) -> usize { @@ -245,7 +244,7 @@ where } fn max_len(&self) -> usize { - cmp::min(self.max, self.base.max_len()) + Ord::min(self.max, self.base.max_len()) } fn split_at(self, index: usize) -> (Self, Self) { diff --git a/src/iter/mod.rs b/src/iter/mod.rs index d2890aab0..963457229 100644 --- a/src/iter/mod.rs +++ b/src/iter/mod.rs @@ -82,7 +82,7 @@ use self::plumbing::*; use self::private::Try; pub use either::Either; -use std::cmp::{self, Ordering}; +use std::cmp::Ordering; use std::collections::LinkedList; use std::iter::{Product, Sum}; use std::ops::{Fn, RangeBounds}; @@ -1432,7 +1432,7 @@ pub trait ParallelIterator: Sized + Send { /// specified, so if the `Ord` impl is not truly associative, then /// the results are not deterministic. /// - /// Basically equivalent to `self.reduce_with(|a, b| cmp::min(a, b))`. + /// Basically equivalent to `self.reduce_with(|a, b| Ord::min(a, b))`. /// /// # Examples /// @@ -1451,7 +1451,7 @@ pub trait ParallelIterator: Sized + Send { where Self::Item: Ord, { - self.reduce_with(cmp::min) + self.reduce_with(Ord::min) } /// Computes the minimum of all the items in the iterator with respect to @@ -1530,7 +1530,7 @@ pub trait ParallelIterator: Sized + Send { /// specified, so if the `Ord` impl is not truly associative, then /// the results are not deterministic. /// - /// Basically equivalent to `self.reduce_with(|a, b| cmp::max(a, b))`. + /// Basically equivalent to `self.reduce_with(|a, b| Ord::max(a, b))`. /// /// # Examples /// @@ -1549,7 +1549,7 @@ pub trait ParallelIterator: Sized + Send { where Self::Item: Ord, { - self.reduce_with(cmp::max) + self.reduce_with(Ord::max) } /// Computes the maximum of all the items in the iterator with respect to diff --git a/src/iter/plumbing/mod.rs b/src/iter/plumbing/mod.rs index 360eecbbc..9d08daacc 100644 --- a/src/iter/plumbing/mod.rs +++ b/src/iter/plumbing/mod.rs @@ -8,7 +8,6 @@ use crate::join_context; use super::IndexedParallelIterator; -use std::cmp; use std::usize; /// The `ProducerCallback` trait is a kind of generic closure, @@ -275,7 +274,7 @@ impl Splitter { if stolen { // This job was stolen! Reset the number of desired splits to the // thread count, if that's more than we had remaining anyway. - self.splits = cmp::max(crate::current_num_threads(), self.splits / 2); + self.splits = Ord::max(crate::current_num_threads(), self.splits / 2); true } else if splits > 0 { // We have splits remaining, make it so. @@ -313,14 +312,14 @@ impl LengthSplitter { fn new(min: usize, max: usize, len: usize) -> LengthSplitter { let mut splitter = LengthSplitter { inner: Splitter::new(), - min: cmp::max(min, 1), + min: Ord::max(min, 1), }; // Divide the given length by the max working length to get the minimum // number of splits we need to get under that max. This rounds down, // but the splitter actually gives `next_power_of_two()` pieces anyway. // e.g. len 12345 / max 100 = 123 min_splits -> 128 pieces. - let min_splits = len / cmp::max(max, 1); + let min_splits = len / Ord::max(max, 1); // Only update the value if it's not splitting enough already. if min_splits > splitter.inner.splits { diff --git a/src/iter/skip.rs b/src/iter/skip.rs index 2d0f9477e..c06ca0547 100644 --- a/src/iter/skip.rs +++ b/src/iter/skip.rs @@ -1,7 +1,6 @@ use super::noop::NoopConsumer; use super::plumbing::*; use super::*; -use std::cmp::min; /// `Skip` is an iterator that skips over the first `n` elements. /// This struct is created by the [`skip()`] method on [`IndexedParallelIterator`] @@ -21,7 +20,7 @@ where { /// Creates a new `Skip` iterator. pub(super) fn new(base: I, n: usize) -> Self { - let n = min(base.len(), n); + let n = Ord::min(base.len(), n); Skip { base, n } } } diff --git a/src/iter/step_by.rs b/src/iter/step_by.rs index 94b8334e8..daf2806a6 100644 --- a/src/iter/step_by.rs +++ b/src/iter/step_by.rs @@ -1,5 +1,3 @@ -use std::cmp::min; - use super::plumbing::*; use super::*; use crate::math::div_round_up; @@ -116,7 +114,7 @@ where } fn split_at(self, index: usize) -> (Self, Self) { - let elem_index = min(index * self.step, self.len); + let elem_index = Ord::min(index * self.step, self.len); let (left, right) = self.base.split_at(elem_index); ( diff --git a/src/iter/take.rs b/src/iter/take.rs index 52d15d805..60ec5436a 100644 --- a/src/iter/take.rs +++ b/src/iter/take.rs @@ -1,6 +1,5 @@ use super::plumbing::*; use super::*; -use std::cmp::min; /// `Take` is an iterator that iterates over the first `n` elements. /// This struct is created by the [`take()`] method on [`IndexedParallelIterator`] @@ -20,7 +19,7 @@ where { /// Creates a new `Take` iterator. pub(super) fn new(base: I, n: usize) -> Self { - let n = min(base.len(), n); + let n = Ord::min(base.len(), n); Take { base, n } } } diff --git a/src/iter/test.rs b/src/iter/test.rs index 1e6c34f8f..f91b7b631 100644 --- a/src/iter/test.rs +++ b/src/iter/test.rs @@ -1708,8 +1708,8 @@ fn check_lengths() { let range = 0..1024 * 1024; // Check against normalized values. - let min_check = cmp::min(cmp::max(min, 1), range.len()); - let max_check = cmp::max(max, min_check.saturating_add(min_check - 1)); + let min_check = Ord::min(Ord::max(min, 1), range.len()); + let max_check = Ord::max(max, min_check.saturating_add(min_check - 1)); assert!( range diff --git a/src/iter/zip.rs b/src/iter/zip.rs index 33823db9e..74fc9774a 100644 --- a/src/iter/zip.rs +++ b/src/iter/zip.rs @@ -1,6 +1,5 @@ use super::plumbing::*; use super::*; -use std::cmp; use std::iter; /// `Zip` is an iterator that zips up `a` and `b` into a single iterator @@ -59,7 +58,7 @@ where } fn len(&self) -> usize { - cmp::min(self.a.len(), self.b.len()) + Ord::min(self.a.len(), self.b.len()) } fn with_producer(self, callback: CB) -> CB::Output @@ -135,11 +134,11 @@ impl Producer for ZipProducer { } fn min_len(&self) -> usize { - cmp::max(self.a.min_len(), self.b.min_len()) + Ord::max(self.a.min_len(), self.b.min_len()) } fn max_len(&self) -> usize { - cmp::min(self.a.max_len(), self.b.max_len()) + Ord::min(self.a.max_len(), self.b.max_len()) } fn split_at(self, index: usize) -> (Self, Self) { diff --git a/src/slice/chunks.rs b/src/slice/chunks.rs index a3cc70953..2b8222ddf 100644 --- a/src/slice/chunks.rs +++ b/src/slice/chunks.rs @@ -1,7 +1,6 @@ use crate::iter::plumbing::*; use crate::iter::*; use crate::math::div_round_up; -use std::cmp; /// Parallel iterator over immutable non-overlapping chunks of a slice #[derive(Debug)] @@ -74,7 +73,7 @@ impl<'data, T: 'data + Sync> Producer for ChunksProducer<'data, T> { } fn split_at(self, index: usize) -> (Self, Self) { - let elem_index = cmp::min(index * self.chunk_size, self.slice.len()); + let elem_index = Ord::min(index * self.chunk_size, self.slice.len()); let (left, right) = self.slice.split_at(elem_index); ( ChunksProducer { @@ -255,7 +254,7 @@ impl<'data, T: 'data + Send> Producer for ChunksMutProducer<'data, T> { } fn split_at(self, index: usize) -> (Self, Self) { - let elem_index = cmp::min(index * self.chunk_size, self.slice.len()); + let elem_index = Ord::min(index * self.chunk_size, self.slice.len()); let (left, right) = self.slice.split_at_mut(elem_index); ( ChunksMutProducer { diff --git a/src/slice/mod.rs b/src/slice/mod.rs index 171675e53..1a1274be7 100644 --- a/src/slice/mod.rs +++ b/src/slice/mod.rs @@ -18,7 +18,7 @@ use self::quicksort::par_quicksort; use crate::iter::plumbing::*; use crate::iter::*; use crate::split_producer::*; -use std::cmp; + use std::cmp::Ordering; use std::fmt::{self, Debug}; use std::mem; @@ -911,7 +911,7 @@ impl<'data, T: 'data + Sync> Producer for WindowsProducer<'data, T> { } fn split_at(self, index: usize) -> (Self, Self) { - let left_index = cmp::min(self.slice.len(), index + (self.window_size - 1)); + let left_index = Ord::min(self.slice.len(), index + (self.window_size - 1)); let left = &self.slice[..left_index]; let right = &self.slice[index..]; ( diff --git a/src/slice/quicksort.rs b/src/slice/quicksort.rs index 2bfc35032..f042bd8f4 100644 --- a/src/slice/quicksort.rs +++ b/src/slice/quicksort.rs @@ -4,7 +4,6 @@ //! The only difference from the original is that calls to `recurse` are executed in parallel using //! `rayon_core::join`. -use std::cmp; use std::marker::PhantomData; use std::mem::{self, MaybeUninit}; use std::ptr; @@ -378,7 +377,7 @@ where } // Number of out-of-order elements to swap between the left and right side. - let count = cmp::min(width(start_l, end_l), width(start_r, end_r)); + let count = Ord::min(width(start_l, end_l), width(start_r, end_r)); if count > 0 { macro_rules! left { @@ -811,7 +810,7 @@ where // Partition the slice. let (mid, was_p) = partition(v, pivot, is_less); - was_balanced = cmp::min(mid, len - mid) >= len / 8; + was_balanced = Ord::min(mid, len - mid) >= len / 8; was_partitioned = was_p; // Split the slice into `left`, `pivot`, and `right`. @@ -819,7 +818,7 @@ where let (pivot, right) = right.split_at_mut(1); let pivot = &mut pivot[0]; - if cmp::max(left.len(), right.len()) <= MAX_SEQUENTIAL { + if Ord::max(left.len(), right.len()) <= MAX_SEQUENTIAL { // Recurse into the shorter side only in order to minimize the total number of recursive // calls and consume less stack space. Then just continue with the longer side (this is // akin to tail recursion). diff --git a/tests/sort-panic-safe.rs b/tests/sort-panic-safe.rs index 95ef88d39..0782cb88a 100644 --- a/tests/sort-panic-safe.rs +++ b/tests/sort-panic-safe.rs @@ -2,7 +2,7 @@ use rand::distributions::Uniform; use rand::{thread_rng, Rng}; use rayon::prelude::*; use std::cell::Cell; -use std::cmp::{self, Ordering}; +use std::cmp::Ordering; use std::panic; use std::sync::atomic::AtomicUsize; use std::sync::atomic::Ordering::Relaxed; @@ -66,7 +66,7 @@ macro_rules! test { let step = if len <= 100 { 1 } else { - cmp::max(1, panic_countdown / 10) + Ord::max(1, panic_countdown / 10) }; // ... and then panic after each `step` comparisons. From a4c8748e3e170083bf5e79210d7a9cd23c5a5524 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Sat, 23 Mar 2024 21:16:53 -0700 Subject: [PATCH 05/18] Fix unused_imports --- rayon-core/src/join/test.rs | 3 +-- rayon-demo/src/life/mod.rs | 1 - rayon-demo/src/map_collect.rs | 1 - rayon-demo/src/nbody/nbody.rs | 2 -- rayon-demo/src/tsp/tour.rs | 2 +- src/iter/find_first_last/test.rs | 1 - src/iter/test.rs | 1 - src/range.rs | 1 - 8 files changed, 2 insertions(+), 10 deletions(-) diff --git a/rayon-core/src/join/test.rs b/rayon-core/src/join/test.rs index b303dbc81..17084db87 100644 --- a/rayon-core/src/join/test.rs +++ b/rayon-core/src/join/test.rs @@ -1,7 +1,6 @@ //! Tests for the join code. -use crate::join::*; -use crate::unwind; +use super::*; use crate::ThreadPoolBuilder; use rand::distributions::Standard; use rand::{Rng, SeedableRng}; diff --git a/rayon-demo/src/life/mod.rs b/rayon-demo/src/life/mod.rs index a89d27255..de74c98ea 100644 --- a/rayon-demo/src/life/mod.rs +++ b/rayon-demo/src/life/mod.rs @@ -24,7 +24,6 @@ use std::thread; use std::time::{Duration, Instant}; use docopt::Docopt; -use rayon::iter::ParallelBridge; use rayon::prelude::*; #[cfg(test)] diff --git a/rayon-demo/src/map_collect.rs b/rayon-demo/src/map_collect.rs index 3a57f18a1..874ac3178 100644 --- a/rayon-demo/src/map_collect.rs +++ b/rayon-demo/src/map_collect.rs @@ -5,7 +5,6 @@ mod util { use rayon::prelude::*; use std::collections::{HashMap, LinkedList}; use std::hash::Hash; - use std::iter::FromIterator; use std::sync::Mutex; /// Do whatever `collect` does by default. diff --git a/rayon-demo/src/nbody/nbody.rs b/rayon-demo/src/nbody/nbody.rs index 877955571..c6e5f3c17 100644 --- a/rayon-demo/src/nbody/nbody.rs +++ b/rayon-demo/src/nbody/nbody.rs @@ -31,8 +31,6 @@ use cgmath::{InnerSpace, Point3, Vector3, Zero}; use rand::Rng; -#[cfg(test)] -use rayon::iter::ParallelBridge; use rayon::prelude::*; use std::f64::consts::PI; diff --git a/rayon-demo/src/tsp/tour.rs b/rayon-demo/src/tsp/tour.rs index d2facee70..3741b60ad 100644 --- a/rayon-demo/src/tsp/tour.rs +++ b/rayon-demo/src/tsp/tour.rs @@ -1,4 +1,4 @@ -use std::cmp::{Eq, Ord, Ordering, PartialEq, PartialOrd}; +use std::cmp::Ordering; use std::sync::Arc; use super::graph::{Node, NodeSet}; diff --git a/src/iter/find_first_last/test.rs b/src/iter/find_first_last/test.rs index 05271bc5b..374296d83 100644 --- a/src/iter/find_first_last/test.rs +++ b/src/iter/find_first_last/test.rs @@ -1,5 +1,4 @@ use super::*; -use std::sync::atomic::AtomicUsize; #[test] fn same_range_first_consumers_return_correct_answer() { diff --git a/src/iter/test.rs b/src/iter/test.rs index f91b7b631..f5d653c07 100644 --- a/src/iter/test.rs +++ b/src/iter/test.rs @@ -7,7 +7,6 @@ use rayon_core::*; use rand::distributions::Standard; use rand::{Rng, SeedableRng}; use rand_xorshift::XorShiftRng; -use std::collections::LinkedList; use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet}; use std::collections::{BinaryHeap, VecDeque}; use std::f64; diff --git a/src/range.rs b/src/range.rs index 57b613e1c..b7131b63a 100644 --- a/src/range.rs +++ b/src/range.rs @@ -19,7 +19,6 @@ use crate::iter::plumbing::*; use crate::iter::*; use std::char; -use std::convert::TryFrom; use std::ops::Range; use std::usize; From 52fb7d91df19375eae9272fc1f88775493098656 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Sat, 23 Mar 2024 21:18:04 -0700 Subject: [PATCH 06/18] Fix clippy::needless_borrowed_reference --- rayon-core/tests/use_current_thread.rs | 2 +- rayon-demo/src/pythagoras/mod.rs | 6 +++--- rayon-demo/src/sort.rs | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/rayon-core/tests/use_current_thread.rs b/rayon-core/tests/use_current_thread.rs index ec801c98d..c509c9bb3 100644 --- a/rayon-core/tests/use_current_thread.rs +++ b/rayon-core/tests/use_current_thread.rs @@ -38,7 +38,7 @@ fn use_current_thread_basic() { assert_ne!(rayon_core::current_thread_index(), Some(0)); // This should execute even if the current thread is blocked, since we have two threads in // the pool. - let &(ref started, ref condvar) = &*pair2; + let (started, condvar) = &*pair2; *started.lock().unwrap() = true; condvar.notify_one(); }); diff --git a/rayon-demo/src/pythagoras/mod.rs b/rayon-demo/src/pythagoras/mod.rs index 5d5b88a1e..39a22a656 100644 --- a/rayon-demo/src/pythagoras/mod.rs +++ b/rayon-demo/src/pythagoras/mod.rs @@ -70,7 +70,7 @@ fn euclid_serial(b: &mut test::Bencher) { fn euclid_faux_serial(b: &mut test::Bencher) { let count = euclid(); let serial = |r: Iter| r.with_min_len(usize::MAX); - b.iter(|| assert_eq!(par_euclid(&serial, &serial), count)) + b.iter(|| assert_eq!(par_euclid(serial, serial), count)) } #[bench] @@ -92,7 +92,7 @@ fn euclid_parallel_one(b: &mut test::Bencher) { fn euclid_parallel_outer(b: &mut test::Bencher) { let count = euclid(); let parallel = |r: Iter| r.with_max_len(1); - b.iter(|| assert_eq!(par_euclid(¶llel, |n| n), count)) + b.iter(|| assert_eq!(par_euclid(parallel, |n| n), count)) } #[bench] @@ -100,5 +100,5 @@ fn euclid_parallel_outer(b: &mut test::Bencher) { fn euclid_parallel_full(b: &mut test::Bencher) { let count = euclid(); let parallel = |r: Iter| r.with_max_len(1); - b.iter(|| assert_eq!(par_euclid(¶llel, ¶llel), count)) + b.iter(|| assert_eq!(par_euclid(parallel, parallel), count)) } diff --git a/rayon-demo/src/sort.rs b/rayon-demo/src/sort.rs index 00fc7bcd3..57a614aa3 100644 --- a/rayon-demo/src/sort.rs +++ b/rayon-demo/src/sort.rs @@ -24,8 +24,8 @@ fn gen_mostly_ascending(len: usize) -> Vec { let len_dist = Uniform::new(0, len); let mut v = gen_ascending(len); for _ in (0usize..).take_while(|x| x * x <= len) { - let x = rng.sample(&len_dist); - let y = rng.sample(&len_dist); + let x = rng.sample(len_dist); + let y = rng.sample(len_dist); v.swap(x, y); } v @@ -36,8 +36,8 @@ fn gen_mostly_descending(len: usize) -> Vec { let len_dist = Uniform::new(0, len); let mut v = gen_descending(len); for _ in (0usize..).take_while(|x| x * x <= len) { - let x = rng.sample(&len_dist); - let y = rng.sample(&len_dist); + let x = rng.sample(len_dist); + let y = rng.sample(len_dist); v.swap(x, y); } v @@ -49,7 +49,7 @@ fn gen_strings(len: usize) -> Vec { let len_dist = Uniform::new(1, 21); let mut v = vec![]; for _ in 0..len { - let n = rng.sample(&len_dist); + let n = rng.sample(len_dist); v.push( rng.sample_iter(&Alphanumeric) .map(char::from) From 466845449205302cc46331a0f52055e899143a81 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Sat, 23 Mar 2024 21:20:24 -0700 Subject: [PATCH 07/18] Fix clippy::thread_local_initializer_can_be_made_const --- tests/sort-panic-safe.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/sort-panic-safe.rs b/tests/sort-panic-safe.rs index 0782cb88a..c45670188 100644 --- a/tests/sort-panic-safe.rs +++ b/tests/sort-panic-safe.rs @@ -115,7 +115,7 @@ macro_rules! test { }; } -thread_local!(static SILENCE_PANIC: Cell = Cell::new(false)); +thread_local!(static SILENCE_PANIC: Cell = const { Cell::new(false) }); #[test] #[cfg_attr(any(target_os = "emscripten", target_family = "wasm"), ignore)] From cec51cc4c1371c8d1fe6d7ee704c7ef96b4c25fc Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Sat, 23 Mar 2024 21:21:55 -0700 Subject: [PATCH 08/18] Fix clippy::needless_borrows_for_generic_args --- tests/sort-panic-safe.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/sort-panic-safe.rs b/tests/sort-panic-safe.rs index c45670188..e1362b964 100644 --- a/tests/sort-panic-safe.rs +++ b/tests/sort-panic-safe.rs @@ -146,8 +146,8 @@ fn sort_panic_safe() { } for _ in 0..5 { - let a = rng.sample(&len_dist); - let b = rng.sample(&len_dist); + let a = rng.sample(len_dist); + let b = rng.sample(len_dist); if a < b { input[a..b].reverse(); } else { From 443dfa204c0be2793c3afc90f05eb80f0b0dc101 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Sat, 23 Mar 2024 21:23:45 -0700 Subject: [PATCH 09/18] Allow clippy::iter_skip_zero --- src/iter/test.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/iter/test.rs b/src/iter/test.rs index f5d653c07..d482db71c 100644 --- a/src/iter/test.rs +++ b/src/iter/test.rs @@ -278,6 +278,7 @@ fn check_skip() { let mut v1 = Vec::new(); a.par_iter().skip(0).collect_into_vec(&mut v1); + #[allow(clippy::iter_skip_zero)] let v2 = a.iter().skip(0).collect::>(); assert_eq!(v1, v2); From c7fdf5dc46379f10d1c0125f37b1ab50fe024da4 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Sat, 23 Mar 2024 21:24:16 -0700 Subject: [PATCH 10/18] Fix clippy::partialeq_to_none --- src/iter/test.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/iter/test.rs b/src/iter/test.rs index d482db71c..62d7f4cb5 100644 --- a/src/iter/test.rs +++ b/src/iter/test.rs @@ -630,7 +630,7 @@ fn check_partial_cmp_none_direct() { let result = a.par_iter().partial_cmp(b.par_iter()); - assert!(result == None); + assert!(result.is_none()); } #[test] From 87d3d22a03f68e51ad4f01d1f7b57f55693274b8 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Sat, 23 Mar 2024 21:25:17 -0700 Subject: [PATCH 11/18] Fix clippy::needless_borrow --- src/iter/fold_chunks.rs | 2 +- src/iter/fold_chunks_with.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/iter/fold_chunks.rs b/src/iter/fold_chunks.rs index 185fb1a65..16e89e72e 100644 --- a/src/iter/fold_chunks.rs +++ b/src/iter/fold_chunks.rs @@ -201,7 +201,7 @@ mod test { assert_eq!(4, (0..8).into_par_iter().fold_chunks(2, id, sum).len()); assert_eq!(3, (0..9).into_par_iter().fold_chunks(3, id, sum).len()); assert_eq!(3, (0..8).into_par_iter().fold_chunks(3, id, sum).len()); - assert_eq!(1, (&[1]).par_iter().fold_chunks(3, id, sum).len()); + assert_eq!(1, [1].par_iter().fold_chunks(3, id, sum).len()); assert_eq!(0, (0..0).into_par_iter().fold_chunks(3, id, sum).len()); } diff --git a/src/iter/fold_chunks_with.rs b/src/iter/fold_chunks_with.rs index af120aec4..58879f310 100644 --- a/src/iter/fold_chunks_with.rs +++ b/src/iter/fold_chunks_with.rs @@ -196,7 +196,7 @@ mod test { assert_eq!(4, (0..8).into_par_iter().fold_chunks_with(2, 0, sum).len()); assert_eq!(3, (0..9).into_par_iter().fold_chunks_with(3, 0, sum).len()); assert_eq!(3, (0..8).into_par_iter().fold_chunks_with(3, 0, sum).len()); - assert_eq!(1, (&[1]).par_iter().fold_chunks_with(3, 0, sum).len()); + assert_eq!(1, [1].par_iter().fold_chunks_with(3, 0, sum).len()); assert_eq!(0, (0..0).into_par_iter().fold_chunks_with(3, 0, sum).len()); } From e8c381ddb43146dccad03822d6b5415d91e594bc Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Sat, 23 Mar 2024 21:27:51 -0700 Subject: [PATCH 12/18] Fix clippy::blocks_in_conditions --- rayon-core/src/scope/test.rs | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/rayon-core/src/scope/test.rs b/rayon-core/src/scope/test.rs index bfec35382..db1e4227a 100644 --- a/rayon-core/src/scope/test.rs +++ b/rayon-core/src/scope/test.rs @@ -216,12 +216,13 @@ fn panic_propagate_nested_scope_spawn() { #[cfg_attr(not(panic = "unwind"), ignore)] fn panic_propagate_still_execute_1() { let mut x = false; - match unwind::halt_unwinding(|| { + let result = unwind::halt_unwinding(|| { scope(|s| { s.spawn(|_| panic!("Hello, world!")); // job A s.spawn(|_| x = true); // job B, should still execute even though A panics }); - }) { + }); + match result { Ok(_) => panic!("failed to propagate panic"), Err(_) => assert!(x, "job b failed to execute"), } @@ -231,12 +232,13 @@ fn panic_propagate_still_execute_1() { #[cfg_attr(not(panic = "unwind"), ignore)] fn panic_propagate_still_execute_2() { let mut x = false; - match unwind::halt_unwinding(|| { + let result = unwind::halt_unwinding(|| { scope(|s| { s.spawn(|_| x = true); // job B, should still execute even though A panics s.spawn(|_| panic!("Hello, world!")); // job A }); - }) { + }); + match result { Ok(_) => panic!("failed to propagate panic"), Err(_) => assert!(x, "job b failed to execute"), } @@ -246,12 +248,13 @@ fn panic_propagate_still_execute_2() { #[cfg_attr(not(panic = "unwind"), ignore)] fn panic_propagate_still_execute_3() { let mut x = false; - match unwind::halt_unwinding(|| { + let result = unwind::halt_unwinding(|| { scope(|s| { s.spawn(|_| x = true); // spawned job should still execute despite later panic panic!("Hello, world!"); }); - }) { + }); + match result { Ok(_) => panic!("failed to propagate panic"), Err(_) => assert!(x, "panic after spawn, spawn failed to execute"), } @@ -261,12 +264,13 @@ fn panic_propagate_still_execute_3() { #[cfg_attr(not(panic = "unwind"), ignore)] fn panic_propagate_still_execute_4() { let mut x = false; - match unwind::halt_unwinding(|| { + let result = unwind::halt_unwinding(|| { scope(|s| { s.spawn(|_| panic!("Hello, world!")); x = true; }); - }) { + }); + match result { Ok(_) => panic!("failed to propagate panic"), Err(_) => assert!(x, "panic in spawn tainted scope"), } From 263c0f3b2b523ad06a642160b1fd7d8f935fbb6d Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Sat, 23 Mar 2024 21:29:10 -0700 Subject: [PATCH 13/18] Allow clippy::declare_interior_mutable_const --- tests/sort-panic-safe.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/sort-panic-safe.rs b/tests/sort-panic-safe.rs index e1362b964..6a54e4a82 100644 --- a/tests/sort-panic-safe.rs +++ b/tests/sort-panic-safe.rs @@ -8,6 +8,8 @@ use std::sync::atomic::AtomicUsize; use std::sync::atomic::Ordering::Relaxed; use std::thread; +// const is needed for array initializer +#[allow(clippy::declare_interior_mutable_const)] const ZERO: AtomicUsize = AtomicUsize::new(0); const LEN: usize = 20_000; From 4609ae33b2b7724b18cc1d8f157a966568c5cf6b Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Sat, 23 Mar 2024 21:29:57 -0700 Subject: [PATCH 14/18] Allow clippy::non_canonical_partial_ord_impl --- tests/sort-panic-safe.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/sort-panic-safe.rs b/tests/sort-panic-safe.rs index 6a54e4a82..5ffe2bb76 100644 --- a/tests/sort-panic-safe.rs +++ b/tests/sort-panic-safe.rs @@ -30,6 +30,7 @@ impl PartialEq for DropCounter { } } +#[allow(clippy::non_canonical_partial_ord_impl)] impl PartialOrd for DropCounter { fn partial_cmp(&self, other: &Self) -> Option { self.version.set(self.version.get() + 1); From 9a9fba4472c8eea93e0fa52d0e299acbe8e041e4 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Sat, 23 Mar 2024 21:32:07 -0700 Subject: [PATCH 15/18] Fix clippy::useless_vec --- tests/producer_split_at.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/tests/producer_split_at.rs b/tests/producer_split_at.rs index d71050492..574fec187 100644 --- a/tests/producer_split_at.rs +++ b/tests/producer_split_at.rs @@ -116,20 +116,17 @@ fn array() { #[test] fn empty() { - let v = vec![42]; - check(&v[..0], rayon::iter::empty); + check(&[], rayon::iter::empty::); } #[test] fn once() { - let v = vec![42]; - check(&v, || rayon::iter::once(42)); + check(&[42], || rayon::iter::once(42)); } #[test] fn option() { - let v = vec![42]; - check(&v, || Some(42)); + check(&[42], || Some(42)); } #[test] From f8d0f47c039e0af87bf4b45497f4a1b39acdbade Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Sat, 23 Mar 2024 21:33:07 -0700 Subject: [PATCH 16/18] Fix clippy::identity_op --- src/iter/fold_chunks.rs | 4 ++-- src/iter/fold_chunks_with.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/iter/fold_chunks.rs b/src/iter/fold_chunks.rs index 16e89e72e..287ec648c 100644 --- a/src/iter/fold_chunks.rs +++ b/src/iter/fold_chunks.rs @@ -208,9 +208,9 @@ mod test { #[test] fn check_fold_chunks_uneven() { let cases: Vec<(Vec, usize, Vec)> = vec![ - ((0..5).collect(), 3, vec![0 + 1 + 2, 3 + 4]), + ((0..5).collect(), 3, vec![1 + 2, 3 + 4]), (vec![1], 5, vec![1]), - ((0..4).collect(), 3, vec![0 + 1 + 2, 3]), + ((0..4).collect(), 3, vec![1 + 2, 3]), ]; for (i, (v, n, expected)) in cases.into_iter().enumerate() { diff --git a/src/iter/fold_chunks_with.rs b/src/iter/fold_chunks_with.rs index 58879f310..e388bddcb 100644 --- a/src/iter/fold_chunks_with.rs +++ b/src/iter/fold_chunks_with.rs @@ -203,9 +203,9 @@ mod test { #[test] fn check_fold_chunks_uneven() { let cases: Vec<(Vec, usize, Vec)> = vec![ - ((0..5).collect(), 3, vec![0 + 1 + 2, 3 + 4]), + ((0..5).collect(), 3, vec![1 + 2, 3 + 4]), (vec![1], 5, vec![1]), - ((0..4).collect(), 3, vec![0 + 1 + 2, 3]), + ((0..4).collect(), 3, vec![1 + 2, 3]), ]; for (i, (v, n, expected)) in cases.into_iter().enumerate() { From 1900fae415ea0e7ceeedd9695696fb3ddc73e613 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Sat, 23 Mar 2024 21:38:04 -0700 Subject: [PATCH 17/18] Allow clippy::incompatible_msrv --- rayon-core/tests/stack_overflow_crash.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/rayon-core/tests/stack_overflow_crash.rs b/rayon-core/tests/stack_overflow_crash.rs index 7dcde43c4..a64940692 100644 --- a/rayon-core/tests/stack_overflow_crash.rs +++ b/rayon-core/tests/stack_overflow_crash.rs @@ -8,6 +8,7 @@ use std::os::unix::process::ExitStatusExt; fn force_stack_overflow(depth: u32) { let mut buffer = [0u8; 1024 * 1024]; + #[allow(clippy::incompatible_msrv)] std::hint::black_box(&mut buffer); if depth > 0 { force_stack_overflow(depth - 1); From 9d33569c83bf4796b0b8d7216ca9b5676feeec51 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Sat, 23 Mar 2024 21:53:58 -0700 Subject: [PATCH 18/18] Use inherent primitive items --- src/iter/test.rs | 3 +-- src/range.rs | 7 ------- src/range_inclusive.rs | 5 ----- tests/chars.rs | 1 - 4 files changed, 1 insertion(+), 15 deletions(-) diff --git a/src/iter/test.rs b/src/iter/test.rs index 62d7f4cb5..08fd57a4c 100644 --- a/src/iter/test.rs +++ b/src/iter/test.rs @@ -60,8 +60,7 @@ fn execute_unindexed_range() { #[test] fn execute_pseudo_indexed_range() { - use std::i128::MAX; - let range = MAX - 1024..MAX; + let range = i128::MAX - 1024..i128::MAX; // Given `Some` length, collecting `Vec` will try to act indexed. let a = range.clone().into_par_iter(); diff --git a/src/range.rs b/src/range.rs index b7131b63a..ed906c7b9 100644 --- a/src/range.rs +++ b/src/range.rs @@ -18,9 +18,7 @@ use crate::iter::plumbing::*; use crate::iter::*; -use std::char; use std::ops::Range; -use std::usize; /// Parallel iterator over a range, implemented for all integer types and `char`. /// @@ -378,8 +376,6 @@ fn check_range_split_at_overflow() { #[test] fn test_i128_len_doesnt_overflow() { - use std::{i128, u128}; - // Using parse because some versions of rust don't allow long literals let octillion: i128 = "1000000000000000000000000000".parse().unwrap(); let producer = IterProducer { @@ -395,7 +391,6 @@ fn test_i128_len_doesnt_overflow() { #[test] fn test_u64_opt_len() { - use std::{u64, usize}; assert_eq!(Some(100), (0..100u64).into_par_iter().opt_len()); assert_eq!( Some(usize::MAX), @@ -414,7 +409,6 @@ fn test_u64_opt_len() { #[test] fn test_u128_opt_len() { - use std::{u128, usize}; assert_eq!(Some(100), (0..100u128).into_par_iter().opt_len()); assert_eq!( Some(usize::MAX), @@ -430,7 +424,6 @@ fn test_u128_opt_len() { #[cfg(target_pointer_width = "64")] fn test_usize_i64_overflow() { use crate::ThreadPoolBuilder; - use std::i64; let iter = (-2..i64::MAX).into_par_iter(); assert_eq!(iter.opt_len(), Some(i64::MAX as usize + 2)); diff --git a/src/range_inclusive.rs b/src/range_inclusive.rs index b7bb0cac7..9c10f0805 100644 --- a/src/range_inclusive.rs +++ b/src/range_inclusive.rs @@ -18,7 +18,6 @@ use crate::iter::plumbing::*; use crate::iter::*; -use std::char; use std::ops::RangeInclusive; /// Parallel iterator over an inclusive range, implemented for all integer types and `char`. @@ -313,7 +312,6 @@ impl IndexedParallelIterator for Iter { #[test] #[cfg(target_pointer_width = "64")] fn test_u32_opt_len() { - use std::u32; assert_eq!(Some(101), (0..=100u32).into_par_iter().opt_len()); assert_eq!( Some(u32::MAX as usize), @@ -327,7 +325,6 @@ fn test_u32_opt_len() { #[test] fn test_u64_opt_len() { - use std::{u64, usize}; assert_eq!(Some(101), (0..=100u64).into_par_iter().opt_len()); assert_eq!( Some(usize::MAX), @@ -339,7 +336,6 @@ fn test_u64_opt_len() { #[test] fn test_u128_opt_len() { - use std::{u128, usize}; assert_eq!(Some(101), (0..=100u128).into_par_iter().opt_len()); assert_eq!( Some(usize::MAX), @@ -355,7 +351,6 @@ fn test_u128_opt_len() { #[cfg(target_pointer_width = "64")] fn test_usize_i64_overflow() { use crate::ThreadPoolBuilder; - use std::i64; let iter = (-2..=i64::MAX).into_par_iter(); assert_eq!(iter.opt_len(), Some(i64::MAX as usize + 3)); diff --git a/tests/chars.rs b/tests/chars.rs index ac8e3f304..6e2804f40 100644 --- a/tests/chars.rs +++ b/tests/chars.rs @@ -1,5 +1,4 @@ use rayon::prelude::*; -use std::char; #[test] fn half_open_correctness() {