Skip to content

Commit 2fd6046

Browse files
committed
glib: Add a lifetime generic to MatchInfo.
Implement MatchInfo manually. Manually implements refcounting and from/into glib ptrs instead of using crate::shared::Shared, since using Shared<_, Self> causes the lifetime parameter to be invariant instead of covariant. Removes array/slice conversions for `MatchInfo`. ValueType/ToValue/HasParamSpec impls are restricted to `MatchInfo<'static>` to avoid use-after-free by converting `MatchInfo<'short>` to `Value`. FromValue is implemented for MatchInfo for any lifetime, since MatchInfo is covariant anyway.
1 parent 24ac207 commit 2fd6046

14 files changed

+571
-161
lines changed

glib/Gir.toml

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -718,19 +718,7 @@ status = "generate"
718718

719719
[[object]]
720720
name = "GLib.MatchInfo"
721-
status = "generate"
722-
[[object.function]]
723-
name = "expand_references"
724-
# impl IntoGStr for parameters instead of &str
725-
manual = true
726-
[[object.function]]
727-
name = "fetch_named"
728-
# impl IntoGStr for parameters instead of &str
729-
manual = true
730-
[[object.function]]
731-
name = "fetch_named_pos"
732-
# impl IntoGStr for parameters instead of &str
733-
manual = true
721+
status = "manual"
734722

735723
[[object]]
736724
name = "GLib.Regex"

glib/src/auto/match_info.rs

Lines changed: 0 additions & 91 deletions
This file was deleted.

glib/src/auto/mod.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@ pub use self::main_loop::MainLoop;
2020
mod markup_parse_context;
2121
pub use self::markup_parse_context::MarkupParseContext;
2222

23-
mod match_info;
24-
pub use self::match_info::MatchInfo;
25-
2623
mod regex;
2724
pub use self::regex::Regex;
2825

glib/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ pub use self::property::*;
182182
mod quark;
183183
pub use self::quark::Quark;
184184
pub mod match_info;
185+
pub use self::match_info::MatchInfo;
185186
pub mod regex;
186187
#[macro_use]
187188
mod log;

0 commit comments

Comments
 (0)