diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7ce6bf29a..b382c1196 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -144,9 +144,6 @@ jobs: key: cargo-${{ github.job }}-${{ matrix.name }}-${{ hashFiles('**/Cargo.lock') }} - name: cargo doc - # Disable cargo doc checking for now, `NSEnumerator2<'a, T>` is broken - # on current nightly. - if: false run: cargo doc --no-deps --document-private-items ${{ matrix.args }} - name: cargo clippy diff --git a/crates/objc2/src/rc/id.rs b/crates/objc2/src/rc/id.rs index a51b9c993..1c5e4db89 100644 --- a/crates/objc2/src/rc/id.rs +++ b/crates/objc2/src/rc/id.rs @@ -663,6 +663,7 @@ impl fmt::Pointer for Id { mod private { use crate::runtime::Object; + use crate::ClassType; use core::panic::{RefUnwindSafe, UnwindSafe}; pub struct UnknownStorage(*const T, Object); @@ -682,6 +683,8 @@ mod private { #[doc(hidden)] pub trait IdSendSyncHelper: mutability::Mutability { + // TODO: Move this to be a hidden type under `Mutability` once GATs + // are in our MSRV. type EquivalentType: ?Sized; } @@ -714,6 +717,19 @@ mod private { impl IdSendSyncHelper for mutability::MainThreadOnly { type EquivalentType = ArcLikeStorage; } + + /// Helper struct for avoiding a gnarly ICE in `rustdoc` when generating + /// documentation for `icrate` iterator helpers (in particular, it fails + /// in generating auto trait implementations). + /// + /// See related issues: + /// - https://github.com/rust-lang/rust/issues/91380 + /// - https://github.com/rust-lang/rust/issues/107715 + pub struct EquivalentType( + >::EquivalentType, + ) + where + T::Mutability: IdSendSyncHelper; } // https://doc.rust-lang.org/nomicon/arc-mutex/arc-base.html#send-and-sync @@ -732,7 +748,7 @@ mod private { unsafe impl Send for Id where T::Mutability: private::IdSendSyncHelper, - >::EquivalentType: Send, + private::EquivalentType: Send, { } @@ -749,7 +765,7 @@ where unsafe impl Sync for Id where T::Mutability: private::IdSendSyncHelper, - >::EquivalentType: Sync, + private::EquivalentType: Sync, { }