We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
While trying to generate bindings against glib 2.73+ in gtk-rs/gtk-rs-core#717 , gir tries to generate the following code which doesn't compile.
gir
#[cfg(any(feature = "v2_74", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v2_74")))] pub fn new_tmp_future( tmpl: Option<impl AsRef<std::path::Path>>, io_priority: glib::Priority, ) -> Pin< Box_<dyn std::future::Future<Output = Result<(File, FileIOStream), glib::Error>> + 'static>, > { let tmpl = tmpl.map(ToOwned::to_owned); Box_::pin(crate::GioFuture::new( &(), move |_obj, cancellable, send| { Self::new_tmp_async( tmpl.as_ref().map(::std::borrow::Borrow::borrow), io_priority, Some(cancellable), move |res| { send.resolve(res); }, ); }, )) } #[cfg(any(feature = "v2_74", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v2_74")))] pub fn new_tmp_dir_future( tmpl: Option<impl AsRef<std::path::Path>>, io_priority: glib::Priority, ) -> Pin<Box_<dyn std::future::Future<Output = Result<File, glib::Error>> + 'static>> { let tmpl = tmpl.map(ToOwned::to_owned); Box_::pin(crate::GioFuture::new( &(), move |_obj, cancellable, send| { Self::new_tmp_dir_async( tmpl.as_ref().map(::std::borrow::Borrow::borrow), io_priority, Some(cancellable), move |res| { send.resolve(res); }, ); }, )) } #[cfg(any(feature = "v2_74", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v2_74")))] fn make_symbolic_link_future( &self, symlink_value: impl AsRef<std::path::Path>, io_priority: glib::Priority, ) -> Pin<Box_<dyn std::future::Future<Output = Result<(), glib::Error>> + 'static>> { let symlink_value = symlink_value.clone(); Box_::pin(crate::GioFuture::new( self, move |obj, cancellable, send| { obj.make_symbolic_link_async( &symlink_value, io_priority, Some(cancellable), move |res| { send.resolve(res); }, ); }, )) }
The code doesn't compile and the it needs the following changes:
diff --git a/gio/src/auto/file.rs b/gio/src/auto/file.rs index bc2c6c4c8e3..8d165759630 100644 --- a/gio/src/auto/file.rs +++ b/gio/src/auto/file.rs @@ -164,12 +164,12 @@ impl File { ) -> Pin< Box_<dyn std::future::Future<Output = Result<(File, FileIOStream), glib::Error>> + 'static>, > { - let tmpl = tmpl.map(ToOwned::to_owned); + let tmpl = tmpl.map(|tmpl| tmpl.as_ref().to_owned()); Box_::pin(crate::GioFuture::new( &(), move |_obj, cancellable, send| { Self::new_tmp_async( - tmpl.as_ref().map(::std::borrow::Borrow::borrow), + tmpl.as_ref().map(<std::path::PathBuf as std::borrow::Borrow<std::path::Path>>::borrow), io_priority, Some(cancellable), move |res| { @@ -238,12 +238,12 @@ impl File { tmpl: Option<impl AsRef<std::path::Path>>, io_priority: glib::Priority, ) -> Pin<Box_<dyn std::future::Future<Output = Result<File, glib::Error>> + 'static>> { - let tmpl = tmpl.map(ToOwned::to_owned); + let tmpl = tmpl.map(|tmpl| tmpl.as_ref().to_owned()); Box_::pin(crate::GioFuture::new( &(), move |_obj, cancellable, send| { Self::new_tmp_dir_async( - tmpl.as_ref().map(::std::borrow::Borrow::borrow), + tmpl.as_ref().map(<std::path::PathBuf as std::borrow::Borrow<std::path::Path>>::borrow), io_priority, Some(cancellable), move |res| { @@ -2056,7 +2056,7 @@ impl<O: IsA<File>> FileExt for O { symlink_value: impl AsRef<std::path::Path>, io_priority: glib::Priority, ) -> Pin<Box_<dyn std::future::Future<Output = Result<(), glib::Error>> + 'static>> { - let symlink_value = symlink_value.clone(); + let symlink_value = symlink_value.as_ref().to_owned(); Box_::pin(crate::GioFuture::new( self, move |obj, cancellable, send| {
gir verion: 74b6e47 gir files: gtk-rs/gir-files@9e94571
The text was updated successfully, but these errors were encountered:
It is the same as #1261 no?
Sorry, something went wrong.
No branches or pull requests
While trying to generate bindings against glib 2.73+ in gtk-rs/gtk-rs-core#717 ,
gir
tries to generate the following code which doesn't compile.The code doesn't compile and the it needs the following changes:
gir verion: 74b6e47
gir files: gtk-rs/gir-files@9e94571
The text was updated successfully, but these errors were encountered: