diff --git a/Cargo.lock b/Cargo.lock index 0066838b4c6a..9bd8acdb1900 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -19,9 +19,9 @@ checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" [[package]] name = "anstyle" -version = "1.0.10" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" +checksum = "862ed96ca487e809f1c8e5a8447f6ee2cf102f846893800b20cebdf541fc6bbd" [[package]] name = "async-tls" @@ -39,9 +39,9 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" [[package]] name = "base64" @@ -60,15 +60,15 @@ dependencies = [ [[package]] name = "bitflags" -version = "2.9.0" +version = "2.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd" +checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967" [[package]] name = "bumpalo" -version = "3.17.0" +version = "3.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" +checksum = "793db76d6187cd04dff33004d8e6c9cc4e05cd330500379d2394209271b4aeee" [[package]] name = "cairo-rs" @@ -90,7 +90,7 @@ dependencies = [ "glib-sys", "libc", "system-deps", - "windows-sys 0.52.0", + "windows-sys 0.59.0", "x11", ] @@ -102,9 +102,9 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "cc" -version = "1.2.22" +version = "1.2.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32db95edf998450acc7881c932f94cd9b05c87b4b2599e8bab064753da4acfd1" +checksum = "d487aa071b5f64da6f19a3e848e3578944b726ee5a4854b82172f02aa876bfdc" dependencies = [ "shlex", ] @@ -121,9 +121,9 @@ dependencies = [ [[package]] name = "cfg-if" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268" [[package]] name = "ciborium" @@ -258,12 +258,12 @@ checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" [[package]] name = "errno" -version = "0.3.11" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "976dd42dc7e85965fe702eb8164f21f450704bdde31faefd6471dba214cb594e" +checksum = "778e2ac28f6c47af28e4907f13ffd1e1ddbd400980a9abd7c8df189bf578a5ad" dependencies = [ "libc", - "windows-sys 0.59.0", + "windows-sys 0.60.2", ] [[package]] @@ -421,7 +421,7 @@ checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" dependencies = [ "cfg-if", "libc", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi 0.11.1+wasi-snapshot-preview1", ] [[package]] @@ -464,7 +464,7 @@ dependencies = [ "shell-words", "system-deps", "tempfile", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -590,9 +590,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.15.3" +version = "0.15.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84b26c544d002229e640969970a2e74021aadf6e2f96372b9c58eff97de08eb3" +checksum = "5971ac85611da7067dbfcabef3c70ebb5606018acd9e2a3903a0da507521e0d5" [[package]] name = "heck" @@ -602,9 +602,9 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "hermit-abi" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f154ce46856750ed433c8649605bf7ed2de3bc35fd9d2a9f30cddd873c80cb08" +checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" [[package]] name = "indexmap" @@ -654,9 +654,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.172" +version = "0.2.174" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d750af042f7ef4f724306de029d18836c26c1765a54a6a3f094cbd23a7267ffa" +checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776" [[package]] name = "linux-raw-sys" @@ -666,9 +666,9 @@ checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" [[package]] name = "lock_api" -version = "0.4.12" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +checksum = "96936507f153605bddfcda068dd804796c84324ed2510809e5b2a624c81da765" dependencies = [ "autocfg", "scopeguard", @@ -682,9 +682,9 @@ checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" [[package]] name = "memchr" -version = "2.7.4" +version = "2.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" +checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" [[package]] name = "num-traits" @@ -757,9 +757,9 @@ dependencies = [ [[package]] name = "parking_lot" -version = "0.12.3" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" +checksum = "70d58bf43669b5795d1576d0641cfb6fbb2057bf629506267a92807158584a13" dependencies = [ "lock_api", "parking_lot_core", @@ -767,15 +767,15 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.10" +version = "0.9.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +checksum = "bc838d2a56b5b1a6c25f55575dfc605fabb63bb2365f6c2353ef9159aa69e4a5" dependencies = [ "cfg-if", "libc", "redox_syscall", "smallvec", - "windows-targets", + "windows-targets 0.52.6", ] [[package]] @@ -853,9 +853,9 @@ dependencies = [ [[package]] name = "r-efi" -version = "5.2.0" +version = "5.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74765f6d916ee2faa39bc8e68e4f3ed8949b48cccdac59983d287a7cb71ce9c5" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" [[package]] name = "rayon" @@ -879,9 +879,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.12" +version = "0.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "928fca9cf2aa042393a8325b9ead81d2f0df4cb12e1e24cef072922ccd99c5af" +checksum = "0d04b7d0ee6b4a0207a0a7adb104d23ecb0b47d6beae7152d0fa34b692b29fd6" dependencies = [ "bitflags", ] @@ -980,9 +980,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.20" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eded382c5f5f786b989652c49544c4877d9f015cc22e145a5ea8ea66c2921cd2" +checksum = "8a0d197bd2c9dc6e53b84da9556a69ba4cdfab8619eb41a8bd1cc2027a0f6b1d" [[package]] name = "ryu" @@ -1064,9 +1064,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.8" +version = "0.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1" +checksum = "bf41e0cfaf7226dca15e8197172c295a782857fcb97fad1808a166870dee75a3" dependencies = [ "serde", ] @@ -1110,18 +1110,15 @@ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "slab" -version = "0.4.9" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" -dependencies = [ - "autocfg", -] +checksum = "04dc19736151f35336d325007ac991178d504a119863a2fcb3758cdb5e52c50d" [[package]] name = "smallvec" -version = "1.15.0" +version = "1.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8917285742e9f3e1683f0a9c4e6b57960b7314d0b08d30d1ecd426713ee2eee9" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" [[package]] name = "spin" @@ -1131,9 +1128,9 @@ checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" [[package]] name = "syn" -version = "2.0.101" +version = "2.0.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce2b7fc941b3a24138a0a7cf8e858bfc6a992e7978a068a5c760deb0ed43caf" +checksum = "e4307e30089d6fd6aff212f2da3a1f9e32f3223b1f010fb09b7c95f90f3ca1e8" dependencies = [ "proc-macro2", "quote", @@ -1193,9 +1190,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.22" +version = "0.8.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05ae329d1f08c4d17a59bed7ff5b5a769d062e64a62d34a3261b219e62cd5aae" +checksum = "dc1beb996b9d83529a9e75c17a1686767d148d70663143c7854d8b4a09ced362" dependencies = [ "serde", "serde_spanned", @@ -1205,18 +1202,18 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.9" +version = "0.6.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3da5db5a963e24bc68be8b17b6fa82814bb22ee8660f192bb182771d498f09a3" +checksum = "22cddaf88f4fbc13c51aebbf5f8eceb5c7c5a9da2ac40a13519eb5b0a0e8f11c" dependencies = [ "serde", ] [[package]] name = "toml_edit" -version = "0.22.26" +version = "0.22.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "310068873db2c5b3e7659d2cc35d21855dbafa50d1ce336397c666e3cb08137e" +checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a" dependencies = [ "indexmap", "serde", @@ -1276,9 +1273,9 @@ dependencies = [ [[package]] name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" +version = "0.11.1+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" [[package]] name = "wasi" @@ -1413,7 +1410,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets", + "windows-targets 0.52.6", ] [[package]] @@ -1422,7 +1419,16 @@ version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" dependencies = [ - "windows-targets", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" +dependencies = [ + "windows-targets 0.53.2", ] [[package]] @@ -1431,14 +1437,30 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_gnullvm", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm 0.52.6", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.53.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c66f69fcc9ce11da9966ddb31a40968cad001c5bedeb5c2b82ede4253ab48aef" +dependencies = [ + "windows_aarch64_gnullvm 0.53.0", + "windows_aarch64_msvc 0.53.0", + "windows_i686_gnu 0.53.0", + "windows_i686_gnullvm 0.53.0", + "windows_i686_msvc 0.53.0", + "windows_x86_64_gnu 0.53.0", + "windows_x86_64_gnullvm 0.53.0", + "windows_x86_64_msvc 0.53.0", ] [[package]] @@ -1447,53 +1469,101 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" + [[package]] name = "windows_aarch64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" + [[package]] name = "windows_i686_gnu" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" +[[package]] +name = "windows_i686_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" + [[package]] name = "windows_i686_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" +[[package]] +name = "windows_i686_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" + [[package]] name = "windows_i686_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" +[[package]] +name = "windows_i686_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" + [[package]] name = "windows_x86_64_gnu" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" +[[package]] +name = "windows_x86_64_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" + [[package]] name = "windows_x86_64_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" + [[package]] name = "windows_x86_64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" + [[package]] name = "winnow" -version = "0.7.10" +version = "0.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06928c8748d81b05c9be96aad92e1b6ff01833332f281e8cfca3be4b35fc9ec" +checksum = "74c7b26e3480b707944fc872477815d29a8e429d2f93a1ce000f5fa84a15cbcd" dependencies = [ "memchr", ] diff --git a/cairo/src/device.rs b/cairo/src/device.rs index c35069396561..4f1a3ee141b2 100644 --- a/cairo/src/device.rs +++ b/cairo/src/device.rs @@ -159,7 +159,7 @@ impl Device { } #[doc(alias = "cairo_device_acquire")] - pub fn acquire(&self) -> Result { + pub fn acquire(&self) -> Result, Error> { unsafe { let status = ffi::cairo_device_acquire(self.to_raw_none()); status_to_result(status)?; diff --git a/cairo/src/image_surface.rs b/cairo/src/image_surface.rs index 1c50e00990ab..c6d3ddc7d097 100644 --- a/cairo/src/image_surface.rs +++ b/cairo/src/image_surface.rs @@ -84,7 +84,7 @@ impl ImageSurface { #[doc(alias = "cairo_image_surface_get_data")] #[doc(alias = "get_data")] - pub fn data(&mut self) -> Result { + pub fn data(&mut self) -> Result, BorrowError> { unsafe { if ffi::cairo_surface_get_reference_count(self.to_raw_none()) > 1 { return Err(BorrowError::NonExclusive); diff --git a/cairo/src/paths.rs b/cairo/src/paths.rs index f870d3165905..2f47a8c5a9c8 100644 --- a/cairo/src/paths.rs +++ b/cairo/src/paths.rs @@ -20,7 +20,7 @@ impl Path { Path(ptr::NonNull::new_unchecked(pointer)) } - pub fn iter(&self) -> PathSegments { + pub fn iter(&self) -> PathSegments<'_> { use std::slice; unsafe { diff --git a/examples/object_subclass/author.rs b/examples/object_subclass/author.rs index 86b6001149b5..be6e3bcc8f5a 100644 --- a/examples/object_subclass/author.rs +++ b/examples/object_subclass/author.rs @@ -14,8 +14,20 @@ mod imp { #[derive(Properties, Default)] #[properties(wrapper_type = super::Author)] pub struct Author { + /// The name of the author + /// + /// Just their given name, not their surname. #[property(get, set)] + /// A helpful name-surname combination. + #[property(name = "name-surname", get = |author: &Self| format!("{} {}", author.name.borrow(), author.surname.borrow()))] name: RefCell, + /// # Getter + /// + /// This is how you can get the surname of the author. + /// + /// # Setter + /// + /// You can change the surname of the author too if you want. #[property(get, set)] surname: RefCell, } diff --git a/gio/src/list_model.rs b/gio/src/list_model.rs index 75c0f522c03a..cfadc854c49f 100644 --- a/gio/src/list_model.rs +++ b/gio/src/list_model.rs @@ -31,7 +31,7 @@ pub trait ListModelExtManual: sealed::Sealed + IsA + Sized { /// # Panics /// /// Panics if `T::static_type().is_a(self.item_type())` is not true. - fn iter>(&self) -> ListModelIter { + fn iter>(&self) -> ListModelIter<'_, LT> { assert!(self.item_type().is_a(LT::static_type())); let len = self.n_items(); diff --git a/gio/src/unix_socket_address.rs b/gio/src/unix_socket_address.rs index 48779e6403d7..ba63a44c893c 100644 --- a/gio/src/unix_socket_address.rs +++ b/gio/src/unix_socket_address.rs @@ -73,7 +73,7 @@ mod sealed { pub trait UnixSocketAddressExtManual: sealed::Sealed + IsA + 'static { #[doc(alias = "g_unix_socket_address_get_path")] #[doc(alias = "get_path")] - fn path(&self) -> Option { + fn path(&self) -> Option> { use self::UnixSocketAddressPath::*; let path = unsafe { diff --git a/glib-macros/src/lib.rs b/glib-macros/src/lib.rs index e3aa4083e521..d8f030f67a91 100644 --- a/glib-macros/src/lib.rs +++ b/glib-macros/src/lib.rs @@ -562,6 +562,10 @@ pub fn closure_local(item: TokenStream) -> TokenStream { /// } /// ``` /// +/// When using the [`Properties`] macro with enums that derive [`Enum`], the default value must be +/// explicitly set via the `builder` parameter of the `#[property]` attribute. See +/// [here](Properties#supported-types) for details. +/// /// An enum can be registered as a dynamic type by setting the derive macro /// helper attribute `enum_dynamic`: /// @@ -1381,6 +1385,10 @@ pub fn cstr_bytes(item: TokenStream) -> TokenStream { /// * `connect_$property_notify()` /// * `notify_$property()` /// +/// # Documentation +/// +/// Doc comments preceding a `#[property]` attribute will be copied to the generated getter and setter methods. You can specify different comments by the getter and setter by using `# Getter` and `# Setter` headings. The text under the header will be copied to the respective method. +/// /// ## Extension trait /// You can choose to move the method definitions to a trait by using `#[properties(wrapper_type = super::MyType, ext_trait = MyTypePropertiesExt)]`. /// The trait name is optional, and defaults to `MyTypePropertiesExt`, where `MyType` is extracted from the wrapper type. @@ -1399,6 +1407,9 @@ pub fn cstr_bytes(item: TokenStream) -> TokenStream { /// Optional types also require the `nullable` attribute: without it, the generated setter on the wrapper type /// will take `T` instead of `Option`, preventing the user from ever calling the setter with a `None` value. /// +/// Notice: For enums that derive [`Enum`] or are C-style enums, you must explicitly specify the +/// default value of the enum using the `builder` parameter in the `#[property]` attribute. +/// /// ## Adding support for custom types /// ### Types wrapping an existing T: [ToValue] + [HasParamSpec] /// If you have declared a newtype as @@ -1423,7 +1434,7 @@ pub fn cstr_bytes(item: TokenStream) -> TokenStream { /// /// # Example /// ``` -/// use std::cell::RefCell; +/// use std::cell::{Cell, RefCell}; /// use glib::prelude::*; /// use glib::subclass::prelude::*; /// use glib_macros::Properties; @@ -1434,6 +1445,14 @@ pub fn cstr_bytes(item: TokenStream) -> TokenStream { /// nick: String, /// } /// +/// #[derive(Debug, Copy, Clone, PartialEq, Eq, glib::Enum, Default)] +/// #[enum_type(name = "MyEnum")] +/// pub enum MyEnum { +/// #[default] +/// Val, +/// OtherVal +/// } +/// /// pub mod imp { /// use std::rc::Rc; /// @@ -1444,7 +1463,9 @@ pub fn cstr_bytes(item: TokenStream) -> TokenStream { /// pub struct Foo { /// #[property(get, set = Self::set_fizz)] /// fizz: RefCell, +/// /// The author's name /// #[property(name = "author-name", get, set, type = String, member = name)] +/// /// The author's childhood nickname /// #[property(name = "author-nick", get, set, type = String, member = nick)] /// author: RefCell, /// #[property(get, set, explicit_notify, lax_validation)] @@ -1457,6 +1478,17 @@ pub fn cstr_bytes(item: TokenStream) -> TokenStream { /// optional: RefCell>, /// #[property(get, set)] /// smart_pointer: Rc>, +/// #[property(get, set, builder(MyEnum::Val))] +/// my_enum: Cell, +/// /// # Getter +/// /// +/// /// Get the value of the property `extra_comments` +/// /// +/// /// # Setter +/// /// +/// /// This is the comment for the setter of the `extra_comments` field. +/// #[property(get, set)] +/// extra_comments: RefCell, /// } /// /// #[glib::derived_properties] diff --git a/glib-macros/src/properties.rs b/glib-macros/src/properties.rs index 35ba2f7ccc4d..c2743290dfcd 100644 --- a/glib-macros/src/properties.rs +++ b/glib-macros/src/properties.rs @@ -12,7 +12,7 @@ use syn::parse::Parse; use syn::punctuated::Punctuated; use syn::spanned::Spanned; use syn::Token; -use syn::{parse_quote_spanned, LitStr}; +use syn::{parse_quote_spanned, Attribute, LitStr}; pub struct PropsMacroInput { wrapper_ty: syn::Path, @@ -255,6 +255,7 @@ struct PropDesc { field_ident: syn::Ident, ty: syn::Type, name: syn::LitStr, + comments: Vec, override_class: Option, override_interface: Option, nullable: bool, @@ -271,6 +272,7 @@ impl PropDesc { attrs_span: proc_macro2::Span, field_ident: syn::Ident, field_ty: syn::Type, + comments: Vec, attrs: ReceivedAttrs, ) -> syn::Result { let ReceivedAttrs { @@ -321,6 +323,7 @@ impl PropDesc { field_ident, ty, name, + comments, override_class, override_interface, nullable, @@ -524,26 +527,33 @@ fn expand_set_property_fn(props: &[PropDesc]) -> TokenStream2 { } fn parse_fields(fields: syn::Fields) -> syn::Result> { - fields - .into_iter() - .flat_map(|field| { - let syn::Field { - ident, attrs, ty, .. - } = field; - attrs - .into_iter() - .filter(|a| a.path().is_ident("property")) - .map(move |prop_attrs| { - let span = prop_attrs.span(); - PropDesc::new( - span, - ident.as_ref().unwrap().clone(), - ty.clone(), - prop_attrs.parse_args()?, - ) - }) - }) - .collect::>() + let mut properties = vec![]; + + for field in fields.into_iter() { + let syn::Field { + ident, attrs, ty, .. + } = field; + // Store the comments until the next `#[property]` we see and then attach them to it. + let mut comments: Vec = vec![]; + for prop_attr in attrs.iter() { + if prop_attr.path().is_ident("doc") { + comments.push(prop_attr.clone()); + } else if prop_attr.path().is_ident("property") { + let span = prop_attr.span(); + let existing_comments = comments; + comments = vec![]; + properties.push(PropDesc::new( + span, + ident.as_ref().unwrap().clone(), + ty.clone(), + existing_comments, + prop_attr.parse_args()?, + )?); + } + } + } + + Ok(properties) } /// Converts a glib property name to a correct rust ident @@ -559,6 +569,50 @@ fn strip_raw_prefix_from_name(name: &LitStr) -> LitStr { ) } +/// Splits the comments for a property between the getter and setter +/// +/// The return tuple is the attributes to copy over into the getter and setter +/// respectively. +fn arrange_property_comments(comments: &[Attribute]) -> (Vec<&Attribute>, Vec<&Attribute>) { + let mut untagged = vec![]; + let mut getter = vec![]; + let mut setter = vec![]; + let mut saw_section = false; + + // We start with no tags so if the programmer doesn't split the comments we can still arrange them. + let mut current_section = &mut untagged; + for attr in comments { + if let syn::Meta::NameValue(meta) = &attr.meta { + if let syn::Expr::Lit(expr) = &meta.value { + if let syn::Lit::Str(lit_str) = &expr.lit { + // Now that we have the one line of comment, see if we need + // to switch a particular section to be the active one (via + // the header syntax) or add the current line to the active + // section. + match lit_str.value().trim() { + "# Getter" => { + current_section = &mut getter; + saw_section = true; + } + "# Setter" => { + current_section = &mut setter; + saw_section = true; + } + _ => current_section.push(attr), + } + } + } + } + } + + // If no sections were defined then we put the same in both + if !saw_section { + return (untagged.clone(), untagged); + } + + (getter, setter) +} + fn expand_impl_getset_properties(props: &[PropDesc]) -> Vec { let crate_ident = crate_ident_new(); let defs = props.iter().filter(|p| !p.is_overriding()).map(|p| { @@ -567,9 +621,12 @@ fn expand_impl_getset_properties(props: &[PropDesc]) -> Vec { let ident = name_to_ident(name); let ty = &p.ty; + let (getter_docs, setter_docs) = arrange_property_comments(&p.comments); + let getter = p.get.is_some().then(|| { let span = p.attrs_span; parse_quote_spanned!(span=> + #(#getter_docs)* #[must_use] #[allow(dead_code)] pub fn #ident(&self) -> <#ty as #crate_ident::property::Property>::Value { @@ -597,12 +654,14 @@ fn expand_impl_getset_properties(props: &[PropDesc]) -> Vec { }; let span = p.attrs_span; parse_quote_spanned!(span=> + #(#setter_docs)* #[allow(dead_code)] pub fn #ident<'a>(&self, value: #set_ty) { self.set_property_from_value(#stripped_name, &::std::convert::From::from(#upcasted_borrowed_value)) } ) }); + [getter, setter] }); defs.flatten() // flattens [] @@ -617,7 +676,9 @@ fn expand_impl_connect_prop_notify(props: &[PropDesc]) -> Vec { let stripped_name = strip_raw_prefix_from_name(name); let fn_ident = format_ident!("connect_{}_notify", name_to_ident(name)); let span = p.attrs_span; + let doc = format!("Listen for notifications of a change in the `{}` property", name.value()); parse_quote_spanned!(span=> + #[doc = #doc] #[allow(dead_code)] pub fn #fn_ident(&self, f: F) -> #crate_ident::SignalHandlerId { self.connect_notify_local(::core::option::Option::Some(#stripped_name), move |this, _| { @@ -636,7 +697,9 @@ fn expand_impl_notify_prop(wrapper_type: &syn::Path, props: &[PropDesc]) -> Vec< let fn_ident = format_ident!("notify_{}", name_to_ident(&name)); let span = p.attrs_span; let enum_ident = name_to_enum_ident(name.value()); + let doc = format!("Notify listeners of a change in the `{}` property", name.value()); parse_quote_spanned!(span=> + #[doc = #doc] #[allow(dead_code)] pub fn #fn_ident(&self) { self.notify_by_pspec( diff --git a/glib/src/collections/list.rs b/glib/src/collections/list.rs index c2c8096d72fa..dd6151a0d613 100644 --- a/glib/src/collections/list.rs +++ b/glib/src/collections/list.rs @@ -101,14 +101,14 @@ impl List { // rustdoc-stripper-ignore-next /// Create a non-destructive iterator over the `List`. #[inline] - pub fn iter(&self) -> Iter { + pub fn iter(&self) -> Iter<'_, T> { Iter::new(self) } // rustdoc-stripper-ignore-next /// Create a non-destructive mutable iterator over the `List`. #[inline] - pub fn iter_mut(&mut self) -> IterMut { + pub fn iter_mut(&mut self) -> IterMut<'_, T> { IterMut::new(self) } diff --git a/glib/src/collections/ptr_slice.rs b/glib/src/collections/ptr_slice.rs index 62d2653e34c3..a1ff43a01f25 100644 --- a/glib/src/collections/ptr_slice.rs +++ b/glib/src/collections/ptr_slice.rs @@ -658,13 +658,21 @@ impl PtrSlice { /// This is guaranteed to be `NULL`-terminated. #[inline] pub fn into_raw(mut self) -> *mut ::GlibType { + // Make sure to allocate a valid pointer that points to a + // NULL-pointer. if self.len == 0 { - ptr::null_mut() - } else { - self.len = 0; - self.capacity = 0; - self.ptr.as_ptr() + self.reserve(0); + unsafe { + ptr::write( + self.ptr.as_ptr().add(0), + Ptr::from(ptr::null_mut::<::GlibType>()), + ); + } } + + self.len = 0; + self.capacity = 0; + self.ptr.as_ptr() } // rustdoc-stripper-ignore-next diff --git a/glib/src/collections/slice.rs b/glib/src/collections/slice.rs index eb674c342480..f4ea17881367 100644 --- a/glib/src/collections/slice.rs +++ b/glib/src/collections/slice.rs @@ -546,8 +546,6 @@ impl Slice { // rustdoc-stripper-ignore-next /// Returns the underlying pointer. - /// - /// This is guaranteed to be `NULL`-terminated. #[inline] pub fn as_ptr(&self) -> *const T::GlibType { if self.len == 0 { @@ -559,8 +557,6 @@ impl Slice { // rustdoc-stripper-ignore-next /// Returns the underlying pointer. - /// - /// This is guaranteed to be `NULL`-terminated. #[inline] pub fn as_mut_ptr(&mut self) -> *mut T::GlibType { if self.len == 0 { @@ -572,8 +568,6 @@ impl Slice { // rustdoc-stripper-ignore-next /// Consumes the slice and returns the underlying pointer. - /// - /// This is guaranteed to be `NULL`-terminated. #[inline] pub fn into_raw(mut self) -> *mut T::GlibType { if self.len == 0 { diff --git a/glib/src/collections/slist.rs b/glib/src/collections/slist.rs index fce48dd52645..6057f4092d49 100644 --- a/glib/src/collections/slist.rs +++ b/glib/src/collections/slist.rs @@ -101,14 +101,14 @@ impl SList { // rustdoc-stripper-ignore-next /// Create a non-destructive iterator over the `SList`. #[inline] - pub fn iter(&self) -> Iter { + pub fn iter(&self) -> Iter<'_, T> { Iter::new(self) } // rustdoc-stripper-ignore-next /// Create a non-destructive mutable iterator over the `SList`. #[inline] - pub fn iter_mut(&mut self) -> IterMut { + pub fn iter_mut(&mut self) -> IterMut<'_, T> { IterMut::new(self) } diff --git a/glib/src/collections/strv.rs b/glib/src/collections/strv.rs index 05ec5821c373..b4cd212ecc43 100644 --- a/glib/src/collections/strv.rs +++ b/glib/src/collections/strv.rs @@ -646,13 +646,18 @@ impl StrV { /// This is guaranteed to be `NULL`-terminated. #[inline] pub fn into_raw(mut self) -> *mut *mut c_char { + // Make sure to allocate a valid pointer that points to a + // NULL-pointer. if self.len == 0 { - ptr::null_mut() - } else { - self.len = 0; - self.capacity = 0; - self.ptr.as_ptr() + self.reserve(0); + unsafe { + *self.ptr.as_ptr().add(0) = ptr::null_mut(); + } } + + self.len = 0; + self.capacity = 0; + self.ptr.as_ptr() } // rustdoc-stripper-ignore-next diff --git a/glib/src/enums.rs b/glib/src/enums.rs index 642f4b179b34..f95a7852e912 100644 --- a/glib/src/enums.rs +++ b/glib/src/enums.rs @@ -748,14 +748,14 @@ impl FlagsClass { // rustdoc-stripper-ignore-next /// Returns a new `FlagsBuilder` for conveniently setting/unsetting flags /// and building a `Value`. - pub fn builder(&self) -> FlagsBuilder { + pub fn builder(&self) -> FlagsBuilder<'_> { FlagsBuilder::new(self) } // rustdoc-stripper-ignore-next /// Returns a new `FlagsBuilder` for conveniently setting/unsetting flags /// and building a `Value`. The `Value` is initialized with `value`. - pub fn builder_with_value(&self, value: Value) -> Option { + pub fn builder_with_value(&self, value: Value) -> Option> { if self.type_() != value.type_() { return None; } @@ -966,12 +966,12 @@ pub type FlagsValues = EnumerationValues; #[must_use = "The builder must be built to be used"] pub struct FlagsBuilder<'a>(&'a FlagsClass, Option); impl FlagsBuilder<'_> { - fn new(flags_class: &FlagsClass) -> FlagsBuilder { + fn new(flags_class: &FlagsClass) -> FlagsBuilder<'_> { let value = unsafe { Value::from_type_unchecked(flags_class.type_()) }; FlagsBuilder(flags_class, Some(value)) } - fn with_value(flags_class: &FlagsClass, value: Value) -> FlagsBuilder { + fn with_value(flags_class: &FlagsClass, value: Value) -> FlagsBuilder<'_> { FlagsBuilder(flags_class, Some(value)) } diff --git a/glib/src/main_context.rs b/glib/src/main_context.rs index 1213046bde55..5c98ead969f6 100644 --- a/glib/src/main_context.rs +++ b/glib/src/main_context.rs @@ -161,7 +161,7 @@ impl MainContext { /// /// This will fail if the main context is owned already by another thread. #[doc(alias = "g_main_context_acquire")] - pub fn acquire(&self) -> Result { + pub fn acquire(&self) -> Result, crate::BoolError> { unsafe { let ret: bool = from_glib(ffi::g_main_context_acquire(self.to_glib_none().0)); if ret { @@ -189,7 +189,7 @@ impl Drop for MainContextAcquireGuard<'_> { struct ThreadDefaultContext<'a>(&'a MainContext); impl ThreadDefaultContext<'_> { - fn new(ctx: &MainContext) -> ThreadDefaultContext { + fn new(ctx: &MainContext) -> ThreadDefaultContext<'_> { unsafe { ffi::g_main_context_push_thread_default(ctx.to_glib_none().0); } diff --git a/glib/src/object.rs b/glib/src/object.rs index 89a94ee0c95a..893c80beda78 100644 --- a/glib/src/object.rs +++ b/glib/src/object.rs @@ -1683,7 +1683,7 @@ pub trait ObjectExt: ObjectType { /// /// `None` is returned if the object does not implement the interface `T`. #[doc(alias = "get_interface")] - fn interface(&self) -> Option>; + fn interface(&self) -> Option>; // rustdoc-stripper-ignore-next /// Sets the property `property_name` of the object to value `value`. @@ -2300,7 +2300,7 @@ impl ObjectExt for T { } #[inline] - fn interface(&self) -> Option> { + fn interface(&self) -> Option> { Interface::from_class(self.object_class()) } @@ -4032,7 +4032,7 @@ impl Class { /// Gets the parent class struct, if any. #[doc(alias = "g_type_class_peek_parent")] #[inline] - pub fn parent(&self) -> Option> { + pub fn parent(&self) -> Option> { unsafe { let ptr = gobject_ffi::g_type_class_peek_parent(&self.0 as *const _ as *mut _); if ptr.is_null() { @@ -4171,7 +4171,7 @@ impl Interface { /// /// This will return `None` if `klass` is not implementing `Self`. #[inline] - pub fn from_class(klass: &Class) -> Option> { + pub fn from_class(klass: &Class) -> Option> { if !klass.type_().is_a(T::static_type()) { return None; } @@ -4241,7 +4241,7 @@ impl Interface { /// interface. #[doc(alias = "g_type_interface_peek_parent")] #[inline] - pub fn parent(&self) -> Option> { + pub fn parent(&self) -> Option> { unsafe { let ptr = gobject_ffi::g_type_interface_peek_parent(&self.0 as *const _ as *mut _); if ptr.is_null() { diff --git a/glib/src/param_spec.rs b/glib/src/param_spec.rs index ec6628e970c4..879aa4ff517c 100644 --- a/glib/src/param_spec.rs +++ b/glib/src/param_spec.rs @@ -1129,14 +1129,14 @@ impl ParamSpecEnum { pub fn builder_with_default + IntoGlib>( name: &str, default_value: T, - ) -> ParamSpecEnumBuilder { + ) -> ParamSpecEnumBuilder<'_, T> { ParamSpecEnumBuilder::new(name, default_value) } #[doc(alias = "g_param_spec_enum")] pub fn builder + IntoGlib + Default>( name: &str, - ) -> ParamSpecEnumBuilder { + ) -> ParamSpecEnumBuilder<'_, T> { ParamSpecEnumBuilder::new(name, T::default()) } } @@ -1272,7 +1272,7 @@ impl ParamSpecFlags { #[doc(alias = "g_param_spec_flags")] pub fn builder + IntoGlib>( name: &str, - ) -> ParamSpecFlagsBuilder { + ) -> ParamSpecFlagsBuilder<'_, T> { ParamSpecFlagsBuilder::new(name) } } @@ -1442,7 +1442,7 @@ impl ParamSpecString { } #[doc(alias = "g_param_spec_string")] - pub fn builder(name: &str) -> ParamSpecStringBuilder { + pub fn builder(name: &str) -> ParamSpecStringBuilder<'_> { ParamSpecStringBuilder::new(name) } } @@ -1577,7 +1577,7 @@ impl ParamSpecBoxed { } #[doc(alias = "g_param_spec_boxed")] - pub fn builder(name: &str) -> ParamSpecBoxedBuilder { + pub fn builder(name: &str) -> ParamSpecBoxedBuilder<'_, T> { ParamSpecBoxedBuilder::new(name) } } @@ -1736,7 +1736,7 @@ impl ParamSpecValueArray { } #[doc(alias = "g_param_spec_value_array")] - pub fn builder(name: &str) -> ParamSpecValueArrayBuilder { + pub fn builder(name: &str) -> ParamSpecValueArrayBuilder<'_> { ParamSpecValueArrayBuilder::new(name) } } @@ -1833,7 +1833,7 @@ impl ParamSpecObject { } #[doc(alias = "g_param_spec_object")] - pub fn builder>(name: &str) -> ParamSpecObjectBuilder { + pub fn builder>(name: &str) -> ParamSpecObjectBuilder<'_, T> { ParamSpecObjectBuilder::new(name) } } diff --git a/glib/src/subclass/types.rs b/glib/src/subclass/types.rs index f8c58101937c..9645de549a5e 100644 --- a/glib/src/subclass/types.rs +++ b/glib/src/subclass/types.rs @@ -754,7 +754,7 @@ pub trait ObjectSubclassExt: ObjectSubclass { /// /// Shorter alias for `instance()`. #[doc(alias = "get_instance")] - fn obj(&self) -> crate::BorrowedObject; + fn obj(&self) -> crate::BorrowedObject<'_, Self::Type>; // rustdoc-stripper-ignore-next /// Returns the implementation from an instance. @@ -785,8 +785,7 @@ impl ObjectSubclassExt for T { Self::from_obj(obj) } - #[inline] - fn obj(&self) -> crate::BorrowedObject { + fn obj(&self) -> crate::BorrowedObject<'_, Self::Type> { unsafe { let data = Self::type_data(); let type_ = data.as_ref().type_(); diff --git a/glib/src/value.rs b/glib/src/value.rs index 42cdd7b267a6..60136d082dd1 100644 --- a/glib/src/value.rs +++ b/glib/src/value.rs @@ -586,7 +586,9 @@ impl Value { // rustdoc-stripper-ignore-next /// Tries to get a value of an owned type `T`. #[inline] - pub fn get_owned(&self) -> Result::Checker as ValueTypeChecker>::Error> + pub fn get_owned( + &self, + ) -> Result>::Checker as ValueTypeChecker>::Error> where T: for<'b> FromValue<'b> + 'static, { diff --git a/glib/src/variant.rs b/glib/src/variant.rs index 0a9491ffa26a..edde050db596 100644 --- a/glib/src/variant.rs +++ b/glib/src/variant.rs @@ -841,7 +841,7 @@ impl Variant { /// } /// # Ok::<(), Box>(()) /// ``` - pub fn array_iter_str(&self) -> Result { + pub fn array_iter_str(&self) -> Result, VariantTypeMismatchError> { let child_ty = String::static_variant_type(); let actual_ty = self.type_(); let expected_ty = child_ty.as_array(); diff --git a/glib/src/variant_type.rs b/glib/src/variant_type.rs index ee477896bc22..339311fed361 100644 --- a/glib/src/variant_type.rs +++ b/glib/src/variant_type.rs @@ -588,7 +588,7 @@ impl VariantTy { /// # Panics /// /// This function panics if not called with a tuple or dictionary entry type. - pub fn tuple_types(&self) -> VariantTyIterator { + pub fn tuple_types(&self) -> VariantTyIterator<'_> { VariantTyIterator::new(self).expect("VariantTy does not represent a tuple") } diff --git a/pango/Gir.toml b/pango/Gir.toml index 2998e9d05da8..00e195c2789d 100644 --- a/pango/Gir.toml +++ b/pango/Gir.toml @@ -168,6 +168,9 @@ status = "generate" name = "from_string" [object.function.return] nullable_return_is_error = "Can't parse AttrList" + [[object.function]] + name = "get_iterator" + manual = true [[object]] name = "Pango.AttrType" diff --git a/pango/src/attr_list.rs b/pango/src/attr_list.rs index f497dd71573f..e47115be123d 100644 --- a/pango/src/attr_list.rs +++ b/pango/src/attr_list.rs @@ -4,7 +4,7 @@ use std::mem; use glib::translate::*; -use crate::{ffi, AttrList, Attribute}; +use crate::{ffi, AttrIterator, AttrList, Attribute}; impl AttrList { #[doc(alias = "pango_attr_list_change")] @@ -45,6 +45,12 @@ impl AttrList { mem::forget(attr); //As attr transferred fully } } + + #[doc(alias = "pango_attr_list_get_iterator")] + #[doc(alias = "get_iterator")] + pub fn iterator(&self) -> AttrIterator<'_> { + unsafe { from_glib_full(ffi::pango_attr_list_get_iterator(self.to_glib_none().0)) } + } } #[cfg(feature = "v1_46")] diff --git a/pango/src/auto/attr_list.rs b/pango/src/auto/attr_list.rs index e366296904d8..ccf897a7ab47 100644 --- a/pango/src/auto/attr_list.rs +++ b/pango/src/auto/attr_list.rs @@ -2,7 +2,7 @@ // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT -use crate::{ffi, AttrIterator, Attribute}; +use crate::{ffi, Attribute}; use glib::translate::*; glib::wrapper! { @@ -63,12 +63,6 @@ impl AttrList { } } - #[doc(alias = "pango_attr_list_get_iterator")] - #[doc(alias = "get_iterator")] - pub fn iterator(&self) -> AttrIterator { - unsafe { from_glib_full(ffi::pango_attr_list_get_iterator(self.to_glib_none().0)) } - } - #[doc(alias = "pango_attr_list_splice")] pub fn splice(&self, other: &AttrList, pos: i32, len: i32) { unsafe { diff --git a/tests/two-levels-glib-dependent/Cargo.lock b/tests/two-levels-glib-dependent/Cargo.lock new file mode 100644 index 000000000000..92bf53f1a364 --- /dev/null +++ b/tests/two-levels-glib-dependent/Cargo.lock @@ -0,0 +1,449 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "autocfg" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" + +[[package]] +name = "bitflags" +version = "2.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967" + +[[package]] +name = "cfg-expr" +version = "0.17.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d4ba6e40bd1184518716a6e1a781bf9160e286d219ccdb8ab2612e74cfe4789" +dependencies = [ + "smallvec", + "target-lexicon", +] + +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "futures-channel" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" +dependencies = [ + "futures-core", +] + +[[package]] +name = "futures-core" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" + +[[package]] +name = "futures-executor" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-macro" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "futures-task" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" + +[[package]] +name = "futures-util" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" +dependencies = [ + "futures-core", + "futures-macro", + "futures-task", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "gio-sys" +version = "0.20.11" +dependencies = [ + "glib-sys", + "gobject-sys", + "libc", + "system-deps", + "windows-sys", +] + +[[package]] +name = "glib" +version = "0.20.11" +dependencies = [ + "bitflags", + "futures-channel", + "futures-core", + "futures-executor", + "futures-task", + "futures-util", + "gio-sys", + "glib-macros", + "glib-sys", + "gobject-sys", + "libc", + "memchr", + "smallvec", +] + +[[package]] +name = "glib-dependent-dependent" +version = "0.1.0" +dependencies = [ + "gstreamer", + "gtk", +] + +[[package]] +name = "glib-macros" +version = "0.20.11" +dependencies = [ + "heck", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "glib-sys" +version = "0.20.11" +dependencies = [ + "libc", + "system-deps", +] + +[[package]] +name = "gobject-sys" +version = "0.20.11" +dependencies = [ + "glib-sys", + "libc", + "system-deps", +] + +[[package]] +name = "gstreamer" +version = "0.1.0" +dependencies = [ + "glib", +] + +[[package]] +name = "gtk" +version = "0.1.0" +dependencies = [ + "glib", +] + +[[package]] +name = "hashbrown" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "indexmap" +version = "2.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c9c992b02b5b4c94ea26e32fe5bccb7aa7d9f390ab5c1221ff895bc7ea8b652" +dependencies = [ + "equivalent", + "hashbrown", +] + +[[package]] +name = "libc" +version = "0.2.172" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d750af042f7ef4f724306de029d18836c26c1765a54a6a3f094cbd23a7267ffa" + +[[package]] +name = "memchr" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" + +[[package]] +name = "pin-project-lite" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkg-config" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" + +[[package]] +name = "proc-macro-crate" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edce586971a4dfaa28950c6f18ed55e0406c1ab88bbce2c6f6293a7aaba73d35" +dependencies = [ + "toml_edit", +] + +[[package]] +name = "proc-macro2" +version = "1.0.95" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "serde" +version = "1.0.218" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8dfc9d19bdbf6d17e22319da49161d5d0108e4188e8b680aef6299eed22df60" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.218" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f09503e191f4e797cb8aac08e9a4a4695c5edf6a2e70e376d961ddd5c969f82b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_spanned" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1" +dependencies = [ + "serde", +] + +[[package]] +name = "slab" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", +] + +[[package]] +name = "smallvec" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8917285742e9f3e1683f0a9c4e6b57960b7314d0b08d30d1ecd426713ee2eee9" + +[[package]] +name = "syn" +version = "2.0.101" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ce2b7fc941b3a24138a0a7cf8e858bfc6a992e7978a068a5c760deb0ed43caf" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "system-deps" +version = "7.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66d23aaf9f331227789a99e8de4c91bf46703add012bdfd45fdecdfb2975a005" +dependencies = [ + "cfg-expr", + "heck", + "pkg-config", + "toml", + "version-compare", +] + +[[package]] +name = "target-lexicon" +version = "0.12.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" + +[[package]] +name = "toml" +version = "0.8.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd87a5cdd6ffab733b2f74bc4fd7ee5fff6634124999ac278c35fc78c6120148" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + +[[package]] +name = "toml_datetime" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.22.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17b4795ff5edd201c7cd6dca065ae59972ce77d1b80fa0a84d94950ece7d1474" +dependencies = [ + "indexmap", + "serde", + "serde_spanned", + "toml_datetime", + "winnow", +] + +[[package]] +name = "unicode-ident" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00e2473a93778eb0bad35909dff6a10d28e63f792f16ed15e404fca9d5eeedbe" + +[[package]] +name = "version-compare" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "852e951cb7832cb45cb1169900d19760cfa39b82bc0ea9c0e5a14ae88411c98b" + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "winnow" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e7f4ea97f6f78012141bcdb6a216b2609f0979ada50b20ca5b52dde2eac2bb1" +dependencies = [ + "memchr", +]