Given a Vala interface method:
public virtual async void hoge_async() {}
gir generates the following trampoline:
unsafe extern "C" fn hoge_async_trampoline<P: FnOnce(()) + 'static>(_source_object: *mut glib::gobject_ffi::GObject, res: *mut gio::ffi::GAsyncResult, user_data: glib::ffi::gpointer) {
let _ = ffi::foo_bar_hoge_finish(_source_object as *mut _, res);
let callback: Box_<glib::thread_guard::ThreadGuard<P>> = Box_::from_raw(user_data as *mut _);
let callback: P = callback.into_inner();
callback(result); // error[E0425]: cannot find value `result` in this scope
}