From 8fc24c959a853f069bfb221e856a638fcad3f24a Mon Sep 17 00:00:00 2001 From: i509VCB Date: Mon, 24 Oct 2022 17:02:52 -0500 Subject: [PATCH] Generate docs.rs documentation with doc_auto_cfg (#2358) --- CHANGELOG.md | 1 + Cargo.toml | 1 + src/lib.rs | 2 ++ 3 files changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 954d4f80..cd2a03c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,7 @@ And please only add new entries to the top of this list, right below the `# Unre - On macOS, added support for `WindowEvent::ThemeChanged`. - **Breaking:** Removed `WindowBuilderExtWindows::with_theme` and `WindowBuilderExtWayland::with_wayland_csd_theme` in favour of `WindowBuilder::with_theme`. - **Breaking:** Removed `WindowExtWindows::theme` in favour of `Window::theme`. +- Enabled `doc_auto_cfg` when generating docs on docs.rs for feature labels. # 0.27.4 diff --git a/Cargo.toml b/Cargo.toml index e6464fba..3638df7a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -32,6 +32,7 @@ targets = [ # WebAssembly "wasm32-unknown-unknown", ] +rustdoc-args = ["--cfg", "docsrs"] [features] default = ["x11", "wayland", "wayland-dlopen", "wayland-csd-adwaita"] diff --git a/src/lib.rs b/src/lib.rs index d6d99ebb..f6276a2f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -135,6 +135,8 @@ #![deny(rustdoc::broken_intra_doc_links)] #![deny(clippy::all)] #![cfg_attr(feature = "cargo-clippy", deny(warnings))] +// Doc feature labels can be tested locally by running RUSTDOCFLAGS="--cfg=docsrs" cargo +nightly doc +#![cfg_attr(docsrs, feature(doc_auto_cfg))] #![allow(clippy::missing_safety_doc)] #[allow(unused_imports)]