diff --git a/.gitignore b/.gitignore index 076b51ff39fc..9d7baa8e320a 100644 --- a/.gitignore +++ b/.gitignore @@ -9,7 +9,6 @@ config.status *.so *.o *.swp -**Cargo.lock gtk/tests/* **~ **/docs.md diff --git a/Cargo.lock b/Cargo.lock index f600f8ed86b0..8fc51e595803 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -51,9 +51,9 @@ checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" [[package]] name = "basic-toml" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2db21524cad41c5591204d22d75e1970a2d1f71060214ca931dc7d5afe2c14e5" +checksum = "823388e228f614e9558c6804262db37960ec8821856535f5c3f59913140558f8" dependencies = [ "serde", ] @@ -66,21 +66,21 @@ 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 = "bumpalo" -version = "3.14.0" +version = "3.15.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" +checksum = "7ff69b9dd49fd426c69a0db9fc04dd934cdb6645ff000864d98f7e2af8830eaa" [[package]] name = "cairo-rs" version = "0.19.2" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", "cairo-sys-rs", "float_eq", "freetype-rs", @@ -97,7 +97,7 @@ dependencies = [ "glib-sys", "libc", "system-deps", - "windows-sys 0.52.0", + "windows-sys", "x11", ] @@ -109,12 +109,9 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "cc" -version = "1.0.83" +version = "1.0.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" -dependencies = [ - "libc", -] +checksum = "8cd6604a82acf3039f1144f54b8eb34e91ffba622051189e71b781822d5ee1f5" [[package]] name = "cfg-expr" @@ -283,7 +280,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys", ] [[package]] @@ -304,7 +301,7 @@ version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b1fad2be0bf06af23adddcf6cd143c94ff0ba3b329691f92d1a38dae5c5aeebf" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", "freetype-sys", "libc", ] @@ -473,7 +470,7 @@ dependencies = [ "shell-words", "system-deps", "tempfile", - "windows-sys 0.52.0", + "windows-sys", ] [[package]] @@ -486,7 +483,7 @@ checksum = "3a5da913a8586ce748f1164c890e1ebe75a7bbc472668f57b7f9fb893d7ac416" name = "glib" version = "0.19.2" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", "criterion", "futures-channel", "futures-core", @@ -519,7 +516,7 @@ name = "glib-macros" version = "0.19.2" dependencies = [ "glib", - "heck", + "heck 0.5.0", "proc-macro-crate", "proc-macro2", "quote", @@ -591,9 +588,9 @@ dependencies = [ [[package]] name = "half" -version = "2.3.1" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc52e53916c08643f1b56ec082790d1e86a32e58dc5268f897f313fbae7b4872" +checksum = "b5eceaaeec696539ddaf7b333340f1af35a5aa87ae3e4f3ead0532f72affab2e" dependencies = [ "cfg-if", "crunchy", @@ -611,17 +608,23 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + [[package]] name = "hermit-abi" -version = "0.3.5" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0c62115964e08cb8039170eb33c1d0e2388a256930279edca206fff675f82c3" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" [[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", @@ -635,7 +638,7 @@ checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b" dependencies = [ "hermit-abi", "libc", - "windows-sys 0.52.0", + "windows-sys", ] [[package]] @@ -655,9 +658,9 @@ checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[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", ] @@ -692,9 +695,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 = "memchr" @@ -808,9 +811,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2900ede94e305130c13ddd391e0ab7cbaeb783945ae07a279c268cb05109c6cb" +checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" [[package]] name = "plotters" @@ -846,14 +849,14 @@ version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" dependencies = [ - "toml_edit", + "toml_edit 0.21.1", ] [[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", ] @@ -869,9 +872,9 @@ dependencies = [ [[package]] name = "rayon" -version = "1.8.1" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa7237101a77a10773db45d62004a272517633fbcc3df19d96455ede1122e051" +checksum = "e4963ed1bc86e4f3ee217022bd855b297cef07fb9eac5dfa1f788b220b49b3bd" dependencies = [ "either", "rayon-core", @@ -910,9 +913,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", @@ -942,16 +945,17 @@ dependencies = [ [[package]] name = "ring" -version = "0.17.7" +version = "0.17.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" +checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" dependencies = [ "cc", + "cfg-if", "getrandom", "libc", "spin 0.9.8", "untrusted 0.9.0", - "windows-sys 0.48.0", + "windows-sys", ] [[package]] @@ -960,11 +964,11 @@ version = "0.38.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", "errno", "libc", "linux-raw-sys", - "windows-sys 0.52.0", + "windows-sys", ] [[package]] @@ -990,9 +994,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.16" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" +checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" [[package]] name = "same-file" @@ -1015,24 +1019,24 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" dependencies = [ - "ring 0.17.7", + "ring 0.17.8", "untrusted 0.9.0", ] [[package]] name = "serde" -version = "1.0.196" +version = "1.0.197" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "870026e60fa08c69f064aa766c10f10b1d62db9ccd4d0abb206472bee0ce3b32" +checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.196" +version = "1.0.197" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" +checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" dependencies = [ "proc-macro2", "quote", @@ -1041,9 +1045,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.113" +version = "1.0.114" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69801b70b1c3dac963ecb03a364ba0ceda9cf60c71cfe475e99864759c8b8a79" +checksum = "c5f09b1bd632ef549eaa9f60a1f8de742bdbc698e6cee2095fc84dde5f549ae0" dependencies = [ "itoa", "ryu", @@ -1119,9 +1123,9 @@ checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" [[package]] name = "syn" -version = "2.0.48" +version = "2.0.53" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +checksum = "7383cd0e49fff4b6b90ca5670bfd3e9d6a733b3f90c686605aa7eec8c4996032" dependencies = [ "proc-macro2", "quote", @@ -1130,12 +1134,12 @@ dependencies = [ [[package]] name = "system-deps" -version = "6.2.0" +version = "6.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a2d580ff6a20c55dfb86be5f9c238f67835d0e81cbdea8bf5680e0897320331" +checksum = "e8e9199467bcbc77c6a13cc6e32a6af21721ab8c96aa0261856c4fda5a4433f0" dependencies = [ "cfg-expr", - "heck", + "heck 0.4.1", "pkg-config", "toml", "version-compare", @@ -1143,20 +1147,20 @@ dependencies = [ [[package]] name = "target-lexicon" -version = "0.12.13" +version = "0.12.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69758bda2e78f098e4ccb393021a0963bb3442eac05f135c30f61b7370bbafae" +checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f" [[package]] name = "tempfile" -version = "3.10.0" +version = "3.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a365e8cd18e44762ef95d87f284f4b5cd04107fec2ff3052bd6a3e6069669e67" +checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" dependencies = [ "cfg-if", "fastrand", "rustix", - "windows-sys 0.52.0", + "windows-sys", ] [[package]] @@ -1170,18 +1174,18 @@ dependencies = [ [[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", @@ -1200,14 +1204,14 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.9" +version = "0.8.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6a4b9e8023eb94392d3dca65d717c53abc5dad49c07cb65bb8fcd87115fa325" +checksum = "e9dd1545e8208b4a5af1aa9bbd0b4cf7e9ea08fabc5d0a5c67fcaafa17433aa3" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit", + "toml_edit 0.22.8", ] [[package]] @@ -1224,12 +1228,23 @@ name = "toml_edit" version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" +dependencies = [ + "indexmap", + "toml_datetime", + "winnow 0.5.40", +] + +[[package]] +name = "toml_edit" +version = "0.22.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c12219811e0c1ba077867254e5ad62ee2c9c190b0d957110750ac0cda1ae96cd" dependencies = [ "indexmap", "serde", "serde_spanned", "toml_datetime", - "winnow", + "winnow 0.6.5", ] [[package]] @@ -1273,9 +1288,9 @@ checksum = "579a42fc0b8e0c63b76519a339be31bed574929511fa53c1a3acae26eb258f29" [[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", @@ -1289,9 +1304,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", @@ -1299,9 +1314,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", @@ -1314,9 +1329,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", @@ -1324,9 +1339,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", @@ -1337,15 +1352,15 @@ 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 = "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", @@ -1357,7 +1372,7 @@ version = "0.22.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed63aea5ce73d0ff405984102c42de94fc55a6b75765d621c65262469b3c9b53" dependencies = [ - "ring 0.17.7", + "ring 0.17.8", "untrusted 0.9.0", ] @@ -1401,22 +1416,13 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", -] - [[package]] name = "windows-sys" version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.52.4", ] [[package]] @@ -1436,17 +1442,17 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" dependencies = [ - "windows_aarch64_gnullvm 0.52.0", - "windows_aarch64_msvc 0.52.0", - "windows_i686_gnu 0.52.0", - "windows_i686_msvc 0.52.0", - "windows_x86_64_gnu 0.52.0", - "windows_x86_64_gnullvm 0.52.0", - "windows_x86_64_msvc 0.52.0", + "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]] @@ -1457,9 +1463,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" +checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" [[package]] name = "windows_aarch64_msvc" @@ -1469,9 +1475,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" +checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" [[package]] name = "windows_i686_gnu" @@ -1481,9 +1487,9 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" +checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" [[package]] name = "windows_i686_msvc" @@ -1493,9 +1499,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" +checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" [[package]] name = "windows_x86_64_gnu" @@ -1505,9 +1511,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" +checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" [[package]] name = "windows_x86_64_gnullvm" @@ -1517,9 +1523,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" +checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" [[package]] name = "windows_x86_64_msvc" @@ -1529,15 +1535,24 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" +checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" [[package]] name = "winnow" -version = "0.5.39" +version = "0.5.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" +dependencies = [ + "memchr", +] + +[[package]] +name = "winnow" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5389a154b01683d28c77f8f68f49dea75f0a4da32557a58f68ee51ebba472d29" +checksum = "dffa400e67ed5a4dd237983829e66475f0a4a26938c4b04c21baede6262215b8" dependencies = [ "memchr", ] diff --git a/deny.toml b/deny.toml index 50424d8c5a36..963e72608081 100644 --- a/deny.toml +++ b/deny.toml @@ -26,6 +26,21 @@ multiple-versions = "deny" wildcards = "allow" highlight = "all" +# proc-macro-crate depends on an older version of toml_edit +# https://github.com/bkchr/proc-macro-crate/pull/50 +[[bans.skip]] +name = "toml_edit" +version = "0.21" +[[bans.skip]] +name = "winnow" +version = "0.5" + +# system-deps depends on an old version of heck +# https://github.com/gdesmott/system-deps/pull/88 +[[bans.skip]] +name = "heck" +version = "0.4" + [sources] unknown-registry = "deny" unknown-git = "deny" diff --git a/gio/src/subclass/application.rs b/gio/src/subclass/application.rs index e6005847bda2..9d5677ec2813 100644 --- a/gio/src/subclass/application.rs +++ b/gio/src/subclass/application.rs @@ -33,7 +33,7 @@ impl ArgumentList { self.items.remove(idx); - glib::ffi::g_free((*self.ptr).add(idx) as *mut c_void); + glib::ffi::g_free(*(*self.ptr).add(idx) as *mut c_void); for i in idx..n_args - 1 { ptr::write((*self.ptr).add(i), *(*self.ptr).add(i + 1)) @@ -419,11 +419,12 @@ mod tests { fn command_line(&self, cmd_line: &crate::ApplicationCommandLine) -> ExitCode { let arguments = cmd_line.arguments(); - for arg in arguments { - // TODO: we need https://github.com/rust-lang/rust/issues/49802 - let a = arg.to_str().unwrap(); - assert!(!a.starts_with("--local-")) - } + // NOTE: on windows argc and argv are ignored, even if the arguments + // were passed explicitly. + // + // Source: https://gitlab.gnome.org/GNOME/glib/-/blob/e64a93269d09302d7a4facbc164b7fe9c2ad0836/gio/gapplication.c#L2513-2515 + #[cfg(not(target_os = "windows"))] + assert_eq!(arguments.to_vec(), &["--global-1", "--global-2"]); EXIT_STATUS.into() } @@ -464,6 +465,9 @@ mod tests { app.set_inactivity_timeout(10000); - assert_eq!(app.run_with_args(&["--local"]), EXIT_STATUS.into()); + assert_eq!( + app.run_with_args(&["--local-1", "--global-1", "--local-2", "--global-2"]), + EXIT_STATUS.into() + ); } } diff --git a/glib-macros/Cargo.toml b/glib-macros/Cargo.toml index fe6bfc82fa48..d82336ecda96 100644 --- a/glib-macros/Cargo.toml +++ b/glib-macros/Cargo.toml @@ -13,7 +13,7 @@ rust-version.workspace = true version.workspace = true [dependencies] -heck = "0.4" +heck = "0.5" proc-macro2 = "1.0" quote = "1.0" syn = { version = "2.0.32", features = ["full"] } diff --git a/glib-macros/src/flags_attribute.rs b/glib-macros/src/flags_attribute.rs index 9c60aa86c96d..9d40dc4bcd2d 100644 --- a/glib-macros/src/flags_attribute.rs +++ b/glib-macros/src/flags_attribute.rs @@ -116,6 +116,26 @@ fn gen_bitflags( } } +fn gen_default( + enum_name: &Ident, + enum_variants: &Punctuated, +) -> Option { + enum_variants + .iter() + .find(|v| v.attrs.iter().any(|attr| attr.path().is_ident("default"))) + .map(|v| { + let default_value = &v.ident; + + quote! { + impl Default for #enum_name { + fn default() -> Self { + Self::from_bits_retain(#enum_name::#default_value.bits()) + } + } + } + }) +} + pub fn impl_flags(attrs: AttrInput, input: &mut syn::ItemEnum) -> TokenStream { let gtype_name = attrs.enum_name; @@ -171,10 +191,13 @@ pub fn impl_flags(attrs: AttrInput, input: &mut syn::ItemEnum) -> TokenStream { }; let bitflags = gen_bitflags(name, visibility, enum_variants, &crate_ident); + let default_impl = gen_default(name, enum_variants); quote! { #bitflags + #default_impl + impl #crate_ident::translate::IntoGlib for #name { type GlibType = u32; diff --git a/glib-macros/tests/test.rs b/glib-macros/tests/test.rs index 59bfdb12cc55..c55342d4c500 100644 --- a/glib-macros/tests/test.rs +++ b/glib-macros/tests/test.rs @@ -244,6 +244,23 @@ fn attr_flags() { assert!(e.value_by_nick("c").is_some()); } +#[test] +fn attr_flags_with_default() { + #[glib::flags(name = "MyFlags")] + enum MyFlags { + #[flags_value(name = "Flag A", nick = "nick-a")] + A = 0b00000001, + #[default] + #[flags_value(name = "Flag B")] + B = 0b00000010, + } + + assert_eq!(MyFlags::A.bits(), 1); + assert_eq!(MyFlags::B.bits(), 2); + assert_eq!(MyFlags::default(), MyFlags::B); + assert_eq!(MyFlags::default().into_glib(), 2); +} + #[test] fn subclassable() { mod foo { diff --git a/glib/src/collections/strv.rs b/glib/src/collections/strv.rs index 89dbc214383f..2e6e46046e2c 100644 --- a/glib/src/collections/strv.rs +++ b/glib/src/collections/strv.rs @@ -1479,21 +1479,21 @@ mod test { let items = ["str1", "str2", "str3", "str4"]; items[..].run_with_strv(|s| unsafe { - assert!(s.get_unchecked(4).is_null()); + assert!((*s.as_ptr().add(4)).is_null()); assert_eq!(s.len(), items.len()); let s = StrV::from_glib_borrow(s.as_ptr() as *const *const c_char); assert_eq!(s, items); }); Vec::from(&items[..]).run_with_strv(|s| unsafe { - assert!(s.get_unchecked(4).is_null()); + assert!((*s.as_ptr().add(4)).is_null()); assert_eq!(s.len(), items.len()); let s = StrV::from_glib_borrow(s.as_ptr() as *const *const c_char); assert_eq!(s, items); }); StrV::from(&items[..]).run_with_strv(|s| unsafe { - assert!(s.get_unchecked(4).is_null()); + assert!((*s.as_ptr().add(4)).is_null()); assert_eq!(s.len(), items.len()); let s = StrV::from_glib_borrow(s.as_ptr() as *const *const c_char); assert_eq!(s, items); @@ -1501,7 +1501,7 @@ mod test { let v = items.iter().copied().map(String::from).collect::>(); items.run_with_strv(|s| unsafe { - assert!(s.get_unchecked(4).is_null()); + assert!((*s.as_ptr().add(4)).is_null()); assert_eq!(s.len(), v.len()); let s = StrV::from_glib_borrow(s.as_ptr() as *const *const c_char); assert_eq!(s, items); @@ -1509,7 +1509,7 @@ mod test { let v = items.iter().copied().map(GString::from).collect::>(); items.run_with_strv(|s| unsafe { - assert!(s.get_unchecked(4).is_null()); + assert!((*s.as_ptr().add(4)).is_null()); assert_eq!(s.len(), v.len()); let s = StrV::from_glib_borrow(s.as_ptr() as *const *const c_char); assert_eq!(s, items); diff --git a/glib/src/main_context_futures.rs b/glib/src/main_context_futures.rs index 04d3e9282164..921a4198fa4e 100644 --- a/glib/src/main_context_futures.rs +++ b/glib/src/main_context_futures.rs @@ -109,6 +109,8 @@ impl TaskSource { } } + ptr::drop_in_place(&mut (*source).return_tx); + // Drop the waker to unref the underlying GSource ptr::drop_in_place(&mut (*source).waker); } @@ -807,4 +809,26 @@ mod tests { ); }); } + + #[test] + fn test_spawn_abort() { + let c = MainContext::new(); + let v = std::sync::Arc::new(1); + let v_clone = v.clone(); + let c_ref = &c; + c.block_on(async move { + let handle = c_ref.spawn(async move { + let _v = v_clone; + let test: u128 = std::future::pending().await; + println!("{test}"); + unreachable!(); + }); + + handle.abort(); + }); + drop(c); + + // Make sure the inner future is actually freed. + assert_eq!(std::sync::Arc::strong_count(&v), 1); + } } diff --git a/glib/src/quark.rs b/glib/src/quark.rs index 183b824a718d..0739b35386de 100644 --- a/glib/src/quark.rs +++ b/glib/src/quark.rs @@ -12,10 +12,16 @@ pub struct Quark(NonZeroU32); impl Quark { #[doc(alias = "g_quark_from_string")] #[allow(clippy::should_implement_trait)] - pub fn from_str(s: impl IntoGStr) -> Quark { + pub fn from_str(s: impl IntoGStr) -> Self { unsafe { s.run_with_gstr(|s| from_glib(ffi::g_quark_from_string(s.as_ptr()))) } } + #[doc(alias = "g_quark_from_static_string")] + #[allow(clippy::should_implement_trait)] + pub fn from_static_str(s: &'static GStr) -> Self { + unsafe { from_glib(ffi::g_quark_from_static_string(s.as_ptr())) } + } + #[allow(clippy::trivially_copy_pass_by_ref)] #[doc(alias = "g_quark_to_string")] pub fn as_str<'a>(&self) -> &'a GStr { @@ -23,7 +29,7 @@ impl Quark { } #[doc(alias = "g_quark_try_string")] - pub fn try_from_str(s: &str) -> Option { + pub fn try_from_str(s: &str) -> Option { unsafe { Self::try_from_glib(ffi::g_quark_try_string(s.to_glib_none().0)).ok() } } } diff --git a/glib/src/subclass/shared.rs b/glib/src/subclass/shared.rs index acd459c6249f..c8958d8a7d87 100644 --- a/glib/src/subclass/shared.rs +++ b/glib/src/subclass/shared.rs @@ -271,6 +271,10 @@ mod test { } assert_eq!(std::sync::Arc::strong_count(&b.0), 2); + unsafe { + let _ = std::sync::Arc::from_raw(inner_raw_ptr); + } + assert_eq!(std::sync::Arc::strong_count(&b.0), 1); } #[test] @@ -291,5 +295,9 @@ mod test { } assert_eq!(std::rc::Rc::strong_count(&b.0), 2); + unsafe { + let _ = std::rc::Rc::from_raw(inner_raw_ptr); + } + assert_eq!(std::rc::Rc::strong_count(&b.0), 1); } } diff --git a/glib/src/unicollate.rs b/glib/src/unicollate.rs index 0f94554d3508..62ea93e90560 100644 --- a/glib/src/unicollate.rs +++ b/glib/src/unicollate.rs @@ -5,7 +5,7 @@ use crate::translate::*; // rustdoc-stripper-ignore-next /// A `CollationKey` allows ordering strings using the linguistically correct rules for the current locale. #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord)] -pub struct CollationKey(String); +pub struct CollationKey(crate::GString); impl> From for CollationKey { // rustdoc-stripper-ignore-next @@ -13,8 +13,13 @@ impl> From for CollationKey { /// collation keys produced by the same function using `std::cmp::Ordering::cmp()`. #[doc(alias = "g_utf8_collate_key")] fn from(s: T) -> Self { - let key = - unsafe { from_glib_full(ffi::g_utf8_collate_key(s.as_ref().to_glib_none().0, -1)) }; + let s = s.as_ref(); + let key = unsafe { + from_glib_full(ffi::g_utf8_collate_key( + s.as_ptr() as *const _, + s.len() as isize, + )) + }; Self(key) } } @@ -24,7 +29,7 @@ impl> From for CollationKey { /// Compared to `CollationKey`, filename collation keys take into consideration dots and other characters /// commonly found in file names. #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord)] -pub struct FilenameCollationKey(String); +pub struct FilenameCollationKey(crate::GString); impl> From for FilenameCollationKey { // rustdoc-stripper-ignore-next @@ -32,10 +37,11 @@ impl> From for FilenameCollationKey { /// collation keys produced by the same function using `std::cmp::Ordering::cmp()`. #[doc(alias = "g_utf8_collate_key_for_filename")] fn from(s: T) -> Self { + let s = s.as_ref(); let key = unsafe { from_glib_full(ffi::g_utf8_collate_key_for_filename( - s.as_ref().to_glib_none().0, - -1, + s.as_ptr() as *const _, + s.len() as isize, )) }; Self(key) diff --git a/pango/src/attr_int.rs b/pango/src/attr_int.rs index 8b85806b5904..443426c5b9a3 100644 --- a/pango/src/attr_int.rs +++ b/pango/src/attr_int.rs @@ -2,12 +2,16 @@ use glib::translate::*; +#[cfg(feature = "v1_50")] +use crate::BaselineShift; #[cfg(feature = "v1_50")] use crate::FontScale; #[cfg(feature = "v1_46")] use crate::Overline; #[cfg(feature = "v1_44")] use crate::ShowFlags; +#[cfg(feature = "v1_50")] +use crate::TextTransform; use crate::{AttrType, Gravity, GravityHint, Stretch, Style, Underline, Variant, Weight}; define_attribute_struct!( @@ -17,7 +21,15 @@ define_attribute_struct!( #[cfg(feature = "v1_50")] AttrType::AbsoluteLineHeight, #[cfg(feature = "v1_50")] + AttrType::BaselineShift, + #[cfg(feature = "v1_50")] AttrType::FontScale, + #[cfg(feature = "v1_50")] + AttrType::Sentence, + #[cfg(feature = "v1_50")] + AttrType::TextTransform, + #[cfg(feature = "v1_50")] + AttrType::Word, AttrType::AllowBreaks, AttrType::BackgroundAlpha, AttrType::Fallback, @@ -46,6 +58,13 @@ impl AttrInt { unsafe { from_glib_full(ffi::pango_attr_line_height_new_absolute(height)) } } + #[cfg(feature = "v1_50")] + #[cfg_attr(docsrs, doc(cfg(feature = "v1_50")))] + #[doc(alias = "pango_attr_baseline_shift_new")] + pub fn new_baseline_shift(shift: BaselineShift) -> Self { + unsafe { from_glib_full(ffi::pango_attr_baseline_shift_new(shift.into_glib())) } + } + #[cfg(feature = "v1_50")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_50")))] #[doc(alias = "pango_attr_font_scale_new")] @@ -53,6 +72,27 @@ impl AttrInt { unsafe { from_glib_full(ffi::pango_attr_font_scale_new(scale.into_glib())) } } + #[cfg(feature = "v1_50")] + #[cfg_attr(docsrs, doc(cfg(feature = "v1_50")))] + #[doc(alias = "pango_attr_sentence_new")] + pub fn new_sentence() -> Self { + unsafe { from_glib_full(ffi::pango_attr_sentence_new()) } + } + + #[cfg(feature = "v1_50")] + #[cfg_attr(docsrs, doc(cfg(feature = "v1_50")))] + #[doc(alias = "pango_attr_text_transform_new")] + pub fn new_text_transform(transform: TextTransform) -> Self { + unsafe { from_glib_full(ffi::pango_attr_text_transform_new(transform.into_glib())) } + } + + #[cfg(feature = "v1_50")] + #[cfg_attr(docsrs, doc(cfg(feature = "v1_50")))] + #[doc(alias = "pango_attr_word_new")] + pub fn new_word() -> Self { + unsafe { from_glib_full(ffi::pango_attr_word_new()) } + } + #[cfg(feature = "v1_44")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_44")))] #[doc(alias = "pango_attr_allow_breaks_new")]