code:
fn _on_click(&self, func: Rc<RefCell<LuaFunction>>) {
let gesture = gtk::GestureClick::new();
gesture.connect_closure("clicked", false, closure_local!(move || {
let a = func.borrow().clone();
a.call::<_, ()>(LuaNil);
}));
self.add_controller(gesture)
}```
The error comes from `closure_local!` (a macro from `gtkrs`)
Error:
```rs
borrowed data escapes outside of method
requirement occurs because of the type `RefCell<mlua::Function<'_>>`, which makes the generic argument `mlua::Function<'_>` invariant
the struct `RefCell<T>` is invariant over the parameter `T`
see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variancerustc
css.rs(76, 25): `func` is a reference that is only valid in the method body
css.rs(76, 25): has type `Rc<RefCell<mlua::Function<'1>>>```
what's the proper way of doing this? 🤔



