From b825e6453dec3eceef918fec9632e8de33932189 Mon Sep 17 00:00:00 2001 From: Tomoaki Kawada Date: Fri, 20 Sep 2024 15:33:57 +0900 Subject: [PATCH] glib: Make `::BuilderFn` generic over lifetimes --- glib-macros/tests/properties.rs | 2 ++ glib/src/param_spec.rs | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/glib-macros/tests/properties.rs b/glib-macros/tests/properties.rs index b9ae8e289a71..e4ca1da704bd 100644 --- a/glib-macros/tests/properties.rs +++ b/glib-macros/tests/properties.rs @@ -93,6 +93,8 @@ mod foo { string_vec: RefCell>, #[property(get, set, builder(glib::VariantTy::DOUBLE))] variant: RefCell>, + #[property(get, set, builder(&>::static_variant_type()))] + variant2: RefCell>, #[property(get = |_| 42.0, set)] infer_inline_type: RefCell, // The following property doesn't store any data. The value of the property is calculated diff --git a/glib/src/param_spec.rs b/glib/src/param_spec.rs index 64fdf0f46e81..ec6628e970c4 100644 --- a/glib/src/param_spec.rs +++ b/glib/src/param_spec.rs @@ -2307,8 +2307,7 @@ has_simple_spec!(bool, ParamSpecBoolean, ParamSpecBooleanBuilder); impl HasParamSpec for crate::Variant { type ParamSpec = ParamSpecVariant; type SetValue = Self; - type BuilderFn = - fn(&'static str, ty: &'static crate::VariantTy) -> ParamSpecVariantBuilder<'static>; + type BuilderFn = for<'a> fn(&'a str, ty: &'a crate::VariantTy) -> ParamSpecVariantBuilder<'a>; fn param_spec_builder() -> Self::BuilderFn { Self::ParamSpec::builder