diff --git a/cairo/src/pdf.rs b/cairo/src/pdf.rs index 87f08aceff9b..d98084a29574 100644 --- a/cairo/src/pdf.rs +++ b/cairo/src/pdf.rs @@ -13,7 +13,7 @@ use std::{ use glib::translate::*; use crate::{Error, PdfVersion, Surface, SurfaceType}; -#[cfg(any(all(feature = "pdf", feature = "v1_16"), docsrs))] +#[cfg(all(feature = "pdf", feature = "v1_16"))] use crate::{PdfMetadata, PdfOutline}; impl PdfVersion { @@ -73,7 +73,7 @@ impl PdfSurface { self.status() } - #[cfg(any(all(feature = "pdf", feature = "v1_16"), docsrs))] + #[cfg(all(feature = "pdf", feature = "v1_16"))] #[doc(alias = "cairo_pdf_surface_set_metadata")] pub fn set_metadata(&self, metadata: PdfMetadata, value: &str) -> Result<(), Error> { let value = CString::new(value).unwrap(); @@ -87,7 +87,7 @@ impl PdfSurface { self.status() } - #[cfg(any(all(feature = "pdf", feature = "v1_18"), docsrs))] + #[cfg(all(feature = "pdf", feature = "v1_18"))] #[doc(alias = "cairo_pdf_surface_set_custom_metadata")] pub fn set_custom_metadata(&self, name: &str, value: &str) -> Result<(), Error> { let name = CString::new(name).unwrap(); @@ -102,7 +102,7 @@ impl PdfSurface { self.status() } - #[cfg(any(all(feature = "pdf", feature = "v1_16"), docsrs))] + #[cfg(all(feature = "pdf", feature = "v1_16"))] #[doc(alias = "cairo_pdf_surface_set_page_label")] pub fn set_page_label(&self, label: &str) -> Result<(), Error> { let label = CString::new(label).unwrap(); @@ -112,7 +112,7 @@ impl PdfSurface { self.status() } - #[cfg(any(all(feature = "pdf", feature = "v1_16"), docsrs))] + #[cfg(all(feature = "pdf", feature = "v1_16"))] #[doc(alias = "cairo_pdf_surface_set_thumbnail_size")] pub fn set_thumbnail_size(&self, width: i32, height: i32) -> Result<(), Error> { unsafe { @@ -125,7 +125,7 @@ impl PdfSurface { self.status() } - #[cfg(any(all(feature = "pdf", feature = "v1_16"), docsrs))] + #[cfg(all(feature = "pdf", feature = "v1_16"))] #[doc(alias = "cairo_pdf_surface_add_outline")] pub fn add_outline( &self, diff --git a/cairo/src/svg.rs b/cairo/src/svg.rs index 01ccb9bbd6cc..84f49752ca32 100644 --- a/cairo/src/svg.rs +++ b/cairo/src/svg.rs @@ -14,7 +14,7 @@ use std::{ #[cfg(feature = "use_glib")] use glib::translate::*; -#[cfg(any(all(feature = "svg", feature = "v1_16"), docsrs))] +#[cfg(all(feature = "svg", feature = "v1_16"))] use crate::SvgUnit; use crate::{Error, Surface, SurfaceType, SvgVersion}; @@ -95,7 +95,7 @@ impl SvgSurface { } } - #[cfg(any(all(feature = "svg", feature = "v1_16"), docsrs))] + #[cfg(all(feature = "svg", feature = "v1_16"))] #[doc(alias = "cairo_svg_surface_set_document_unit")] pub fn set_document_unit(&mut self, unit: SvgUnit) { unsafe { @@ -103,7 +103,7 @@ impl SvgSurface { } } - #[cfg(any(all(feature = "svg", feature = "v1_16"), docsrs))] + #[cfg(all(feature = "svg", feature = "v1_16"))] #[doc(alias = "cairo_svg_surface_get_document_unit")] #[doc(alias = "get_document_unit")] pub fn document_unit(&self) -> SvgUnit { diff --git a/gio/src/lib.rs b/gio/src/lib.rs index f53ce42455c8..0bbb86370706 100644 --- a/gio/src/lib.rs +++ b/gio/src/lib.rs @@ -34,7 +34,7 @@ mod dbus_node_info; #[cfg(feature = "v2_72")] #[cfg_attr(docsrs, doc(cfg(feature = "v2_72")))] mod debug_controller_dbus; -#[cfg(any(all(not(windows), not(target_os = "macos")), docsrs))] +#[cfg(all(not(windows), not(target_os = "macos")))] mod desktop_app_info; mod error; mod file; @@ -43,9 +43,9 @@ pub use crate::file_attribute_info::FileAttributeInfo; mod file_attribute_info_list; mod file_attribute_matcher; pub use crate::file_attribute_matcher::FileAttributematcherIter; -#[cfg(any(unix, docsrs))] +#[cfg(unix)] mod file_descriptor_based; -#[cfg(any(unix, docsrs))] +#[cfg(unix)] pub use file_descriptor_based::FileDescriptorBased; mod file_enumerator; pub use crate::file_enumerator::FileEnumeratorStream; @@ -84,19 +84,19 @@ pub use socket_msg_flags::SocketMsgFlags; mod subprocess; mod subprocess_launcher; mod threaded_socket_service; -#[cfg(any(unix, docsrs))] +#[cfg(unix)] mod unix_fd_list; -#[cfg(any(unix, docsrs))] +#[cfg(unix)] mod unix_fd_message; -#[cfg(any(unix, docsrs))] +#[cfg(unix)] mod unix_input_stream; -#[cfg(any(unix, docsrs))] +#[cfg(unix)] mod unix_mount_entry; -#[cfg(any(unix, docsrs))] +#[cfg(unix)] mod unix_mount_point; -#[cfg(any(unix, docsrs))] +#[cfg(unix)] mod unix_output_stream; -#[cfg(any(unix, docsrs))] +#[cfg(unix)] mod unix_socket_address; #[cfg(test)] diff --git a/gio/src/socket.rs b/gio/src/socket.rs index 574f046e2a3a..044bfd747659 100644 --- a/gio/src/socket.rs +++ b/gio/src/socket.rs @@ -46,7 +46,7 @@ impl Socket { } } -#[cfg(any(unix, docsrs))] +#[cfg(unix)] #[cfg_attr(docsrs, doc(cfg(unix)))] impl AsRawFd for Socket { fn as_raw_fd(&self) -> RawFd { @@ -54,7 +54,7 @@ impl AsRawFd for Socket { } } -#[cfg(any(windows, docsrs))] +#[cfg(windows)] #[cfg_attr(docsrs, doc(cfg(windows)))] impl AsRawSocket for Socket { fn as_raw_socket(&self) -> RawSocket { diff --git a/gio/src/subprocess_launcher.rs b/gio/src/subprocess_launcher.rs index 2216d83b2443..21a5e32e1884 100644 --- a/gio/src/subprocess_launcher.rs +++ b/gio/src/subprocess_launcher.rs @@ -3,8 +3,7 @@ #[cfg(any(unix, all(docsrs, unix)))] use std::os::unix::io::IntoRawFd; -#[cfg(any(unix, docsrs))] -#[cfg(any(unix, docsrs))] +#[cfg(unix)] use glib::translate::*; use crate::SubprocessLauncher; @@ -17,7 +16,7 @@ pub trait IntoRawFd: Sized { } impl SubprocessLauncher { - #[cfg(any(unix, docsrs))] + #[cfg(unix)] #[cfg_attr(docsrs, doc(cfg(unix)))] #[doc(alias = "g_subprocess_launcher_take_fd")] pub fn take_fd(&self, source_fd: impl IntoRawFd, target_fd: impl IntoRawFd) { @@ -30,7 +29,7 @@ impl SubprocessLauncher { } } - #[cfg(any(unix, docsrs))] + #[cfg(unix)] #[cfg_attr(docsrs, doc(cfg(unix)))] #[doc(alias = "g_subprocess_launcher_take_stderr_fd")] pub fn take_stderr_fd(&self, fd: impl IntoRawFd) { @@ -39,7 +38,7 @@ impl SubprocessLauncher { } } - #[cfg(any(unix, docsrs))] + #[cfg(unix)] #[cfg_attr(docsrs, doc(cfg(unix)))] #[doc(alias = "g_subprocess_launcher_take_stdin_fd")] pub fn take_stdin_fd(&self, fd: impl IntoRawFd) { @@ -48,7 +47,7 @@ impl SubprocessLauncher { } } - #[cfg(any(unix, docsrs))] + #[cfg(unix)] #[cfg_attr(docsrs, doc(cfg(unix)))] #[doc(alias = "g_subprocess_launcher_take_stdout_fd")] pub fn take_stdout_fd(&self, fd: impl IntoRawFd) { diff --git a/gio/src/unix_mount_point.rs b/gio/src/unix_mount_point.rs index 849bf582971e..cd4ccc7f92ea 100644 --- a/gio/src/unix_mount_point.rs +++ b/gio/src/unix_mount_point.rs @@ -7,7 +7,7 @@ use glib::translate::*; use crate::UnixMountPoint; impl UnixMountPoint { - #[cfg(any(unix, docsrs))] + #[cfg(unix)] #[doc(alias = "g_unix_mount_points_get")] #[doc(alias = "get_mount_points")] pub fn mount_points() -> (Vec, u64) { diff --git a/glib/src/source.rs b/glib/src/source.rs index e75c7d693ec8..17825a985a46 100644 --- a/glib/src/source.rs +++ b/glib/src/source.rs @@ -8,7 +8,7 @@ use ffi::{self, gboolean, gpointer}; #[cfg(all(not(unix), docsrs))] use libc::c_int as RawFd; -#[cfg(any(unix, docsrs))] +#[cfg(unix)] use crate::IOCondition; use crate::{thread_guard::ThreadGuard, translate::*, ControlFlow, MainContext, Source}; @@ -151,7 +151,7 @@ fn into_raw_child_watch_local(func: F) -> gpointer Box::into_raw(func) as gpointer } -#[cfg(any(unix, docsrs))] +#[cfg(unix)] #[cfg_attr(docsrs, doc(cfg(unix)))] unsafe extern "C" fn trampoline_unix_fd< F: FnMut(RawFd, IOCondition) -> ControlFlow + Send + 'static, @@ -164,7 +164,7 @@ unsafe extern "C" fn trampoline_unix_fd< (*func.borrow_mut())(fd, from_glib(condition)).into_glib() } -#[cfg(any(unix, docsrs))] +#[cfg(unix)] #[cfg_attr(docsrs, doc(cfg(unix)))] unsafe extern "C" fn trampoline_unix_fd_local< F: FnMut(RawFd, IOCondition) -> ControlFlow + 'static, @@ -177,7 +177,7 @@ unsafe extern "C" fn trampoline_unix_fd_local< (*func.get_ref().borrow_mut())(fd, from_glib(condition)).into_glib() } -#[cfg(any(unix, docsrs))] +#[cfg(unix)] #[cfg_attr(docsrs, doc(cfg(unix)))] unsafe extern "C" fn destroy_closure_unix_fd< F: FnMut(RawFd, IOCondition) -> ControlFlow + Send + 'static, @@ -187,7 +187,7 @@ unsafe extern "C" fn destroy_closure_unix_fd< let _ = Box::>::from_raw(ptr as *mut _); } -#[cfg(any(unix, docsrs))] +#[cfg(unix)] #[cfg_attr(docsrs, doc(cfg(unix)))] unsafe extern "C" fn destroy_closure_unix_fd_local< F: FnMut(RawFd, IOCondition) -> ControlFlow + 'static, @@ -197,7 +197,7 @@ unsafe extern "C" fn destroy_closure_unix_fd_local< let _ = Box::>>::from_raw(ptr as *mut _); } -#[cfg(any(unix, docsrs))] +#[cfg(unix)] #[cfg_attr(docsrs, doc(cfg(unix)))] fn into_raw_unix_fd ControlFlow + Send + 'static>( func: F, @@ -206,7 +206,7 @@ fn into_raw_unix_fd ControlFlow + Send + 'static Box::into_raw(func) as gpointer } -#[cfg(any(unix, docsrs))] +#[cfg(unix)] #[cfg_attr(docsrs, doc(cfg(unix)))] fn into_raw_unix_fd_local ControlFlow + 'static>( func: F, @@ -630,7 +630,7 @@ where } } -#[cfg(any(unix, docsrs))] +#[cfg(unix)] #[cfg_attr(docsrs, doc(cfg(unix)))] // rustdoc-stripper-ignore-next /// Adds a closure to be called by the default main loop whenever a UNIX signal is raised. @@ -656,7 +656,7 @@ where } } -#[cfg(any(unix, docsrs))] +#[cfg(unix)] #[cfg_attr(docsrs, doc(cfg(unix)))] // rustdoc-stripper-ignore-next /// Adds a closure to be called by the default main loop whenever a UNIX signal is raised. @@ -677,7 +677,7 @@ where unix_signal_add(signum, fnmut_callback_wrapper(func)) } -#[cfg(any(unix, docsrs))] +#[cfg(unix)] #[cfg_attr(docsrs, doc(cfg(unix)))] // rustdoc-stripper-ignore-next /// Adds a closure to be called by the default main loop whenever a UNIX signal is raised. @@ -713,7 +713,7 @@ where } } -#[cfg(any(unix, docsrs))] +#[cfg(unix)] #[cfg_attr(docsrs, doc(cfg(unix)))] // rustdoc-stripper-ignore-next /// Adds a closure to be called by the default main loop whenever a UNIX signal is raised. @@ -740,7 +740,7 @@ where unix_signal_add_local(signum, fnmut_callback_wrapper_local(func)) } -#[cfg(any(unix, docsrs))] +#[cfg(unix)] #[cfg_attr(docsrs, doc(cfg(unix)))] // rustdoc-stripper-ignore-next /// Adds a closure to be called by the main loop the returned `Source` is attached to whenever a @@ -768,7 +768,7 @@ where } } -#[cfg(any(unix, docsrs))] +#[cfg(unix)] #[cfg_attr(docsrs, doc(cfg(unix)))] // rustdoc-stripper-ignore-next /// Adds a closure to be called by the main loop the returned `Source` is attached to whenever a @@ -988,7 +988,7 @@ where } } -#[cfg(any(unix, docsrs))] +#[cfg(unix)] #[cfg_attr(docsrs, doc(cfg(unix)))] // rustdoc-stripper-ignore-next /// Adds a closure to be called by the main loop the returned `Source` is attached to whenever a @@ -1024,7 +1024,7 @@ where } } -#[cfg(any(unix, docsrs))] +#[cfg(unix)] #[cfg_attr(docsrs, doc(cfg(unix)))] // rustdoc-stripper-ignore-next /// Adds a closure to be called by the main loop the returned `Source` is attached to whenever a diff --git a/glib/src/source_futures.rs b/glib/src/source_futures.rs index f483301813b7..e1d164baea4b 100644 --- a/glib/src/source_futures.rs +++ b/glib/src/source_futures.rs @@ -194,7 +194,7 @@ pub fn child_watch_future_with_priority( })) } -#[cfg(any(unix, docsrs))] +#[cfg(unix)] #[cfg_attr(docsrs, doc(cfg(unix)))] // rustdoc-stripper-ignore-next /// Create a `Future` that will resolve once the given UNIX signal is raised @@ -204,7 +204,7 @@ pub fn unix_signal_future(signum: i32) -> Pin + Send unix_signal_future_with_priority(crate::Priority::default(), signum) } -#[cfg(any(unix, docsrs))] +#[cfg(unix)] #[cfg_attr(docsrs, doc(cfg(unix)))] // rustdoc-stripper-ignore-next /// Create a `Future` that will resolve once the given UNIX signal is raised @@ -380,7 +380,7 @@ pub fn interval_stream_seconds_with_priority( })) } -#[cfg(any(unix, docsrs))] +#[cfg(unix)] #[cfg_attr(docsrs, doc(cfg(unix)))] // rustdoc-stripper-ignore-next /// Create a `Stream` that will provide a value whenever the given UNIX signal is raised @@ -390,7 +390,7 @@ pub fn unix_signal_stream(signum: i32) -> Pin + Send + unix_signal_stream_with_priority(crate::Priority::default(), signum) } -#[cfg(any(unix, docsrs))] +#[cfg(unix)] #[cfg_attr(docsrs, doc(cfg(unix)))] // rustdoc-stripper-ignore-next /// Create a `Stream` that will provide a value whenever the given UNIX signal is raised