From 1417dd650c7addd92e3abed6b85d8ffee23976a4 Mon Sep 17 00:00:00 2001 From: Mads Marquart Date: Thu, 8 Dec 2022 10:02:42 +0100 Subject: [PATCH] Improve docs.rs output of icrate --- .github/workflows/ci.yml | 2 +- crates/icrate/Cargo.toml | 7 ++++--- crates/icrate/src/common.rs | 2 +- crates/icrate/src/lib.rs | 1 + 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 219977807..72873eba7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -160,7 +160,7 @@ jobs: # Use --no-fail-fast, except with dinghy TESTARGS: ${{ matrix.dinghy && ' ' || '--no-fail-fast' }} ${{ matrix.test-args }} SOME_FEATURES: ${{ matrix.features || 'malloc,block,exception,Foundation' }} - FEATURES: ${{ matrix.features || 'malloc,block,exception,Foundation,catch-all,verify,uuid' }} + FEATURES: ${{ matrix.features || 'malloc,block,exception,unstable-all-frameworks,catch-all,verify,uuid' }} UNSTABLE_FEATURES: ${{ matrix.unstable-features || 'unstable-autoreleasesafe,unstable-c-unwind' }} CMD: cargo diff --git a/crates/icrate/Cargo.toml b/crates/icrate/Cargo.toml index 0d34a82dd..9536b3961 100644 --- a/crates/icrate/Cargo.toml +++ b/crates/icrate/Cargo.toml @@ -27,7 +27,7 @@ uuid = { version = "1.1.2", optional = true, default-features = false } [package.metadata.docs.rs] default-target = "x86_64-apple-darwin" -all-features = true +features = ["block", "objective-c", "uuid", "unstable-all-frameworks", "unstable-docsrs"] targets = [ # MacOS @@ -81,7 +81,7 @@ gnustep-2-1 = ["gnustep-2-0", "objc2?/gnustep-2-1", "block2?/gnustep-2-1"] objective-c = ["objc2"] # Expose features that requires creating blocks. -blocks = ["objc2?/block", "block2"] +block = ["objc2?/block", "block2"] # For better documentation on docs.rs unstable-docsrs = [] @@ -91,4 +91,5 @@ unstable-docsrs = [] AppKit = ["Foundation", "CoreData"] AuthenticationServices = ["Foundation"] CoreData = ["Foundation"] -Foundation = ["objective-c", "blocks"] +Foundation = ["objective-c", "block"] +unstable-all-frameworks = ["AppKit", "AuthenticationServices", "CoreData", "Foundation"] diff --git a/crates/icrate/src/common.rs b/crates/icrate/src/common.rs index d370de668..6d9ab2690 100644 --- a/crates/icrate/src/common.rs +++ b/crates/icrate/src/common.rs @@ -19,7 +19,7 @@ pub(crate) use objc2::runtime::{Bool, Class, Object, Sel}; #[cfg(feature = "objective-c")] pub(crate) use objc2::{__inner_extern_class, extern_class, extern_methods, ClassType, Message}; -#[cfg(feature = "blocks")] +#[cfg(feature = "block")] pub(crate) use block2::Block; // TODO diff --git a/crates/icrate/src/lib.rs b/crates/icrate/src/lib.rs index 1aaf6d74c..c90368f16 100644 --- a/crates/icrate/src/lib.rs +++ b/crates/icrate/src/lib.rs @@ -1,4 +1,5 @@ #![no_std] +#![cfg_attr(feature = "unstable-docsrs", feature(doc_auto_cfg))] #![warn(elided_lifetimes_in_paths)] #![deny(non_ascii_idents)] #![warn(unreachable_pub)]