diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index daf1e1982..3d93d4402 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -65,7 +65,7 @@ jobs: ] include: # Test minimal supported Rust version - - rust: 1.48.0 + - rust: 1.56.1 python-version: 3.8 platform: { os: "ubuntu-latest", python-architecture: "x64", rust-target: "x86_64-unknown-linux-gnu" } msrv: "MSRV" diff --git a/Cargo.lock b/Cargo.lock index 5b6e97400..de38d6794 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -13,6 +13,18 @@ dependencies = [ "version_check", ] +[[package]] +name = "ahash" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57e6e951cfbb2db8de1828d49073a113a29fd7117b1596caa781a258c7e38d72" +dependencies = [ + "cfg-if", + "getrandom", + "once_cell", + "version_check", +] + [[package]] name = "autocfg" version = "1.1.0" @@ -33,9 +45,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "crossbeam-channel" -version = "0.5.4" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aaa7bd5fb665c6864b5f963dd9097905c54125909c7aa94c9e18507cdbe6c53" +checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521" dependencies = [ "cfg-if", "crossbeam-utils", @@ -43,9 +55,9 @@ dependencies = [ [[package]] name = "crossbeam-deque" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6455c0ca19f0d2fbf751b908d5c55c1f5cbc65e03c4225427254b46890bdde1e" +checksum = "715e8152b692bba2d374b53d4875445368fdf21a94751410af607a5ac677d1fc" dependencies = [ "cfg-if", "crossbeam-epoch", @@ -54,33 +66,31 @@ dependencies = [ [[package]] name = "crossbeam-epoch" -version = "0.9.8" +version = "0.9.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1145cf131a2c6ba0615079ab6a638f7e1973ac9c2634fcbeaaad6114246efe8c" +checksum = "f916dfc5d356b0ed9dae65f1db9fc9770aa2851d2662b988ccf4fe3516e86348" dependencies = [ "autocfg", "cfg-if", "crossbeam-utils", - "lazy_static", "memoffset", "scopeguard", ] [[package]] name = "crossbeam-utils" -version = "0.8.8" +version = "0.8.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf124c720b7686e3c2663cf54062ab0f68a88af2fb6a030e87e30bf721fcb38" +checksum = "edbafec5fa1f196ca66527c1b12c2ec4745ca14b50f1ad8f9f6f720b55d11fac" dependencies = [ "cfg-if", - "lazy_static", ] [[package]] name = "either" -version = "1.6.1" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" +checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" [[package]] name = "fixedbitset" @@ -90,9 +100,9 @@ checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "getrandom" -version = "0.2.6" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9be70c98951c83b8d2f8f60d7065fa6d5146873094452a1008da8c2f1e4205ad" +checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" dependencies = [ "cfg-if", "libc", @@ -104,8 +114,14 @@ name = "hashbrown" version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" dependencies = [ - "ahash", + "ahash 0.7.6", "rayon", ] @@ -125,48 +141,33 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc633605454125dec4b66843673f01c7df2b89479b32e0ed634e43a91cff62a5" dependencies = [ "autocfg", - "hashbrown", + "hashbrown 0.11.2", "rayon", ] [[package]] name = "indoc" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05a0bd019339e5d968b37855180087b7b9d512c5046fbd244cf8c95687927d6e" - -[[package]] -name = "instant" -version = "0.1.12" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" -dependencies = [ - "cfg-if", -] +checksum = "adab1eaa3408fb7f0c777a73e7465fd5656136fc93b670eb6df3c88c2c1344e3" [[package]] name = "itoa" -version = "1.0.2" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "112c678d4050afce233f4f2852bb2eb519230b3cf12f33585275537d7e41578d" - -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "4217ad341ebadf8d8e724e264f13e593e0648f5b3e94b3896a5df283be015ecc" [[package]] name = "libc" -version = "0.2.126" +version = "0.2.137" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836" +checksum = "fc7fcc620a3bff7cdd7a365be3376c97191aeaccc2a603e600951e452615bf89" [[package]] name = "lock_api" -version = "0.4.7" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327fa5b6a6940e4699ec49a9beae1ea4845c6bab9314e4f84ac68742139d8c53" +checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" dependencies = [ "autocfg", "scopeguard", @@ -174,9 +175,9 @@ dependencies = [ [[package]] name = "matrixmultiply" -version = "0.2.4" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "916806ba0031cd542105d916a97c8572e1fa6dd79c9c51e7eb43a09ec2dd84c1" +checksum = "add85d4dd35074e6fedc608f8c8f513a3548619a9024b751949ef0e8e45a4d84" dependencies = [ "rawpointer", ] @@ -198,12 +199,12 @@ dependencies = [ [[package]] name = "ndarray" -version = "0.13.1" +version = "0.15.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac06db03ec2f46ee0ecdca1a1c34a99c0d188a0d83439b84bf0cb4b386e4ab09" +checksum = "adb12d4e967ec485a5f71c6311fe28158e9d6f4bc4a447b474184d0f91a8fa32" dependencies = [ "matrixmultiply", - "num-complex 0.2.4", + "num-complex", "num-integer", "num-traits", "rawpointer", @@ -223,19 +224,9 @@ dependencies = [ [[package]] name = "num-complex" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6b19411a9719e753aff12e5187b74d60d3dc449ec3f4dc21e3989c3f554bc95" -dependencies = [ - "autocfg", - "num-traits", -] - -[[package]] -name = "num-complex" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97fbc387afefefd5e9e39493299f3069e14a140dd34dc19b4c1c1a8fddb6a790" +checksum = "7ae39348c8bc5fbd7f40c727a9925f03517afd2ab27d46702108b6a7e5414c19" dependencies = [ "num-traits", ] @@ -275,10 +266,10 @@ version = "0.17.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a462c1af5ba1fddec1488c4646993a23ae7931f9e170ccba23e9c7c834277797" dependencies = [ - "ahash", + "ahash 0.7.6", "libc", "ndarray", - "num-complex 0.4.1", + "num-complex", "num-integer", "num-traits", "pyo3", @@ -286,33 +277,31 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.12.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7709cef83f0c1f58f666e746a08b21e0085f7440fa6a29cc194d68aac97a4225" +checksum = "e82dad04139b71a90c080c8463fe0dc7902db5192d939bd0950f074d014339e1" [[package]] name = "parking_lot" -version = "0.11.2" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" dependencies = [ - "instant", "lock_api", "parking_lot_core", ] [[package]] name = "parking_lot_core" -version = "0.8.5" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d76e8e1493bcac0d2766c42737f34458f1c8c50c0d23bcb24ea953affb273216" +checksum = "4dc9e0dc2adc1c69d09143aff38d3d30c5c3f0df0dad82e6d25547af174ebec0" dependencies = [ "cfg-if", - "instant", "libc", "redox_syscall", "smallvec", - "winapi", + "windows-sys", ] [[package]] @@ -333,9 +322,9 @@ checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" [[package]] name = "priority-queue" -version = "1.2.0" +version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf40e51ccefb72d42720609e1d3c518de8b5800d723a09358d4a6d6245e1f8ca" +checksum = "de9cde7493f5f5d2d163b174be9f9a72d756b79b0f6ed85654128d238c347c1e" dependencies = [ "autocfg", "indexmap", @@ -343,9 +332,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.39" +version = "1.0.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c54b25569025b7fc9651de43004ae593a75ad88543b17178aa5e1b9c4f15f56f" +checksum = "5ea3d908b0e36316caf9e9e2c4625cdde190a7e6f440d794667ed17a1855e725" dependencies = [ "unicode-ident", ] @@ -357,13 +346,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "201b6887e5576bf2f945fe65172c1fcbf3fcf285b23e4d71eb171d9736e38d32" dependencies = [ "cfg-if", - "hashbrown", + "hashbrown 0.12.3", "indexmap", "indoc", "libc", "memoffset", "num-bigint", - "num-complex 0.4.1", + "num-complex", "parking_lot", "pyo3-build-config", "pyo3-ffi", @@ -425,9 +414,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.18" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1feb54ed693b93a84e14094943b84b7c4eae204c512b7ccb95ab0c66d278ad1" +checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" dependencies = [ "proc-macro2", ] @@ -455,9 +444,9 @@ dependencies = [ [[package]] name = "rand_core" -version = "0.6.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ "getrandom", ] @@ -503,9 +492,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.2.13" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62f25bc4c7e55e0b0b7a1d43fb893f4fa1361d0abe38b9ce4f323c2adfe6ef42" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" dependencies = [ "bitflags", ] @@ -514,13 +503,13 @@ dependencies = [ name = "rustworkx" version = "0.13.0" dependencies = [ - "ahash", + "ahash 0.8.0", "fixedbitset", - "hashbrown", + "hashbrown 0.12.3", "indexmap", "ndarray", "num-bigint", - "num-complex 0.4.1", + "num-complex", "num-traits", "numpy", "petgraph", @@ -538,9 +527,9 @@ dependencies = [ name = "rustworkx-core" version = "0.13.0" dependencies = [ - "ahash", + "ahash 0.8.0", "fixedbitset", - "hashbrown", + "hashbrown 0.12.3", "indexmap", "num-traits", "petgraph", @@ -551,9 +540,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.10" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3f6f92acf49d1b98f7a81226834412ada05458b7364277387724a237f062695" +checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" [[package]] name = "scopeguard" @@ -594,15 +583,15 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.8.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2dd574626839106c320a323308629dcb1acfc96e32a8cba364ddc61ac23ee83" +checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" [[package]] name = "syn" -version = "1.0.96" +version = "1.0.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0748dd251e24453cb8717f0354206b91557e4ec8703673a4b30208f2abaf1ebf" +checksum = "a864042229133ada95abf3b54fdc62ef5ccabe9515b64717bcb9a1919e59445d" dependencies = [ "proc-macro2", "quote", @@ -617,15 +606,15 @@ checksum = "c02424087780c9b71cc96799eaeddff35af2bc513278cda5c99fc1f5d026d3c1" [[package]] name = "unicode-ident" -version = "1.0.0" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d22af068fba1eb5edcb4aea19d382b2a3deb4c8f9d475c589b6ada9e0fd493ee" +checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3" [[package]] name = "unindent" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52fee519a3e570f7df377a06a1a7775cdbfb7aa460be7e08de2b1f0e69973a44" +checksum = "58ee9362deb4a96cef4d437d1ad49cffc9b9e92d202b6995674e928ce684f112" [[package]] name = "version_check" @@ -635,28 +624,63 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "wasi" -version = "0.10.2+wasi-snapshot-preview1" +version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] -name = "winapi" -version = "0.3.9" +name = "windows-sys" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", ] [[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" +name = "windows_aarch64_gnullvm" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028" [[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" +name = "windows_x86_64_msvc" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5" diff --git a/Cargo.toml b/Cargo.toml index 189ac876a..bd215cfa9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,7 +7,7 @@ license = "Apache-2.0" readme = "README.md" repository = "https://github.com/Qiskit/rustworkx" keywords = ["python", "graph"] -edition = "2018" +edition = "2021" [workspace] members = [ @@ -19,7 +19,7 @@ name = "rustworkx" crate-type = ["cdylib"] [dependencies] -ahash = { version = "0.7.6", default-features = false } +ahash = "0.8.0" petgraph = "0.6.2" fixedbitset = "0.4.2" numpy = "0.17.2" @@ -39,11 +39,11 @@ version = "0.17.2" features = ["extension-module", "hashbrown", "num-bigint", "num-complex", "indexmap"] [dependencies.hashbrown] -version = "0.11" +version = "0.12" features = ["rayon"] [dependencies.ndarray] -version = "^0.13.1" +version = "^0.15.6" features = ["rayon"] [dependencies.indexmap] diff --git a/README.md b/README.md index 391c84104..ae31524ca 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ [![](https://img.shields.io/github/release/Qiskit/rustworkx.svg?style=popout-square)](https://github.com/Qiskit/rustworkx/releases) [![](https://img.shields.io/pypi/dm/rustworkx.svg?style=popout-square)](https://pypi.org/project/rustworkx/) [![Coverage Status](https://coveralls.io/repos/github/Qiskit/rustworkx/badge.svg?branch=main)](https://coveralls.io/github/Qiskit/rustworkx?branch=main) -[![Minimum rustc 1.48.0](https://img.shields.io/badge/rustc-1.48.0+-blue.svg)](https://rust-lang.github.io/rfcs/2495-min-rust-version.html) +[![Minimum rustc 1.56.1](https://img.shields.io/badge/rustc-1.56.1+-blue.svg)](https://rust-lang.github.io/rfcs/2495-min-rust-version.html) [![arXiv](https://img.shields.io/badge/arXiv-2110.15221-b31b1b.svg)](https://arxiv.org/abs/2110.15221) - You can see the full rendered docs at: @@ -50,7 +50,7 @@ environment. If there are no precompiled binaries published for your system you'll have to build the package from source. However, to be able able to build the package -from the published source package you need to have Rust >= 1.48.0 installed (and +from the published source package you need to have Rust >= 1.56.1 installed (and also [cargo](https://doc.rust-lang.org/cargo/) which is normally included with rust) You can use [rustup](https://rustup.rs/) (a cross platform installer for rust) to make this simpler, or rely on diff --git a/docs/source/install.rst b/docs/source/install.rst index e34084f2b..ed2964696 100644 --- a/docs/source/install.rst +++ b/docs/source/install.rst @@ -25,7 +25,7 @@ Installing on a platform without precompiled binaries If there are no precompiled binaries published for your system you'll have to build the package from source. However, to be able able to build the package from -the published source package you need to have Rust >= 1.48.0 installed (and also +the published source package you need to have Rust >= 1.56.1 installed (and also cargo which is normally included with rust) You can use `rustup `_ (a cross platform installer for rust) to make this simpler, or rely on diff --git a/releasenotes/notes/bump-msrv-4c746d8fbd91ea7c.yaml b/releasenotes/notes/bump-msrv-4c746d8fbd91ea7c.yaml new file mode 100644 index 000000000..2c0cca7b7 --- /dev/null +++ b/releasenotes/notes/bump-msrv-4c746d8fbd91ea7c.yaml @@ -0,0 +1,7 @@ +--- +upgrade: + - | + The minimum supported Rust version has been increased from 1.48 to 1.56.1. + This applies to both building the rustworkx package from source as well as the + rustworkx-crate. This change was made to facilitate using newer versions of our + upstream dependencies as well as leveraging newer Rust language features. diff --git a/rustworkx-core/Cargo.toml b/rustworkx-core/Cargo.toml index a73f9c5dc..031138f88 100644 --- a/rustworkx-core/Cargo.toml +++ b/rustworkx-core/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "rustworkx-core" version = "0.13.0" -edition = "2018" +edition = "2021" authors = ["Matthew Treinish "] description = "Rust APIs used for rustworkx algorithms" license = "Apache-2.0" @@ -11,15 +11,15 @@ homepage = "https://github.com/Qiskit/rustworkx/tree/main/rustworkx-core" keywords = ["graph"] [dependencies] -ahash = { version = "0.7.6", default-features = false } +ahash = "0.8.0" fixedbitset = "0.4.2" petgraph = "0.6.2" rayon = "1.5" num-traits = "0.2" -priority-queue = "1.2.0" +priority-queue = "1.2" [dependencies.hashbrown] -version = "0.11" +version = "0.12" features = ["rayon"] [dependencies.indexmap] diff --git a/rustworkx-core/clippy.toml b/rustworkx-core/clippy.toml index 11d46a73f..56ce04e44 100644 --- a/rustworkx-core/clippy.toml +++ b/rustworkx-core/clippy.toml @@ -1 +1 @@ -msrv = "1.48.0" +msrv = "1.56.1" diff --git a/rustworkx-core/src/max_weight_matching.rs b/rustworkx-core/src/max_weight_matching.rs index 72e1b9102..193b1ff87 100644 --- a/rustworkx-core/src/max_weight_matching.rs +++ b/rustworkx-core/src/max_weight_matching.rs @@ -395,7 +395,7 @@ fn expand_blossom( labels[endpoints[p ^ 1]] = Some(0); if j < 0 { let length = blossom_endpoints[blossom].len(); - let index = length - j.abs() as usize; + let index = length - j.unsigned_abs() as usize; labels[endpoints [blossom_endpoints[blossom][index - endpoint_trick] ^ endpoint_trick ^ 1]] = Some(0); @@ -423,7 +423,7 @@ fn expand_blossom( let endpoint_index = if j < 0 { let tmp = j - endpoint_trick as i128; let length = blossom_endpoints[blossom].len(); - let index = length - tmp.abs() as usize; + let index = length - tmp.unsigned_abs() as usize; blossom_endpoints[blossom][index] } else { blossom_endpoints[blossom][j as usize - endpoint_trick] @@ -433,7 +433,7 @@ fn expand_blossom( p = if j < 0 { let tmp = j - endpoint_trick as i128; let length = blossom_endpoints[blossom].len(); - let index = length - tmp.abs() as usize; + let index = length - tmp.unsigned_abs() as usize; blossom_endpoints[blossom][index] ^ endpoint_trick } else { blossom_endpoints[blossom][j as usize - endpoint_trick] ^ endpoint_trick @@ -446,7 +446,7 @@ fn expand_blossom( // its mate (so don't call assign_label()) let blossom_v = if j < 0 { let length = blossom_children[blossom].len(); - let index = length - j.abs() as usize; + let index = length - j.unsigned_abs() as usize; blossom_children[blossom][index] } else { blossom_children[blossom][j as usize] @@ -460,7 +460,7 @@ fn expand_blossom( j += j_step; let mut j_index = if j < 0 { let length = blossom_children[blossom].len(); - length - j.abs() as usize + length - j.unsigned_abs() as usize } else { j as usize }; @@ -475,7 +475,7 @@ fn expand_blossom( j += j_step; if j < 0 { let length = blossom_children[blossom].len(); - j_index = length - j.abs() as usize; + j_index = length - j.unsigned_abs() as usize; } else { j_index = j as usize; } @@ -514,7 +514,7 @@ fn expand_blossom( j += j_step; if j < 0 { let length = blossom_children[blossom].len(); - j_index = length - j.abs() as usize; + j_index = length - j.unsigned_abs() as usize; } else { j_index = j as usize; } @@ -588,14 +588,14 @@ fn augment_blossom( tmp = if j < 0 { let length = blossom_children[blossom].len(); - let index = length - j.abs() as usize; + let index = length - j.unsigned_abs() as usize; blossom_children[blossom][index] } else { blossom_children[blossom][j as usize] }; let p = if j < 0 { let length = blossom_endpoints[blossom].len(); - let index = length - j.abs() as usize - endpoint_trick; + let index = length - j.unsigned_abs() as usize - endpoint_trick; blossom_endpoints[blossom][index] ^ endpoint_trick } else { blossom_endpoints[blossom][j as usize - endpoint_trick] ^ endpoint_trick @@ -616,7 +616,7 @@ fn augment_blossom( j += j_step; if j < 0 { let length = blossom_children[blossom].len(); - let index = length - j.abs() as usize; + let index = length - j.unsigned_abs() as usize; tmp = blossom_children[blossom][index]; } else { tmp = blossom_children[blossom][j as usize]; diff --git a/src/connectivity/johnson_simple_cycles.rs b/src/connectivity/johnson_simple_cycles.rs index 42ac5f865..23ffafbe8 100644 --- a/src/connectivity/johnson_simple_cycles.rs +++ b/src/connectivity/johnson_simple_cycles.rs @@ -10,6 +10,7 @@ // License for the specific language governing permissions and limitations // under the License. +use ahash::RandomState; use hashbrown::{HashMap, HashSet}; use indexmap::IndexSet; @@ -61,7 +62,7 @@ pub struct SimpleCycleIter { blocked: HashSet, closed: HashSet, block: HashMap>, - stack: Vec<(NodeIndex, IndexSet)>, + stack: Vec<(NodeIndex, IndexSet)>, start_node: NodeIndex, node_map: HashMap, reverse_node_map: HashMap, @@ -115,8 +116,7 @@ fn unblock( blocked: &mut HashSet, block: &mut HashMap>, ) { - let mut stack: IndexSet = - IndexSet::with_hasher(ahash::RandomState::new()); + let mut stack: IndexSet = IndexSet::with_hasher(RandomState::default()); stack.insert(node); while let Some(stack_node) = stack.pop() { if blocked.remove(&stack_node) { diff --git a/src/graphml.rs b/src/graphml.rs index 2d4e35387..b1af4793f 100644 --- a/src/graphml.rs +++ b/src/graphml.rs @@ -347,7 +347,7 @@ enum State { } macro_rules! matches { - ($expression:expr, $( $pattern:pat )|+) => { + ($expression:expr, $( $pattern:pat_param )|+) => { match $expression { $( $pattern )|+ => {}, _ => {