Skip to content

Commit

Permalink
Add test to ensure that documenting auto traits of Id<AnyObject> works
Browse files Browse the repository at this point in the history
  • Loading branch information
madsmtm committed Sep 11, 2023
1 parent 9b30f3b commit fe33f6c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions crates/objc2/src/rc/id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -761,8 +761,7 @@ mod private {
}

/// 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).
/// documentation for auto traits for `Id<T>` where `T: !ClassType`.
///
/// See related issues:
/// - <https://github.com/rust-lang/rust/issues/91380>
Expand Down Expand Up @@ -822,6 +821,12 @@ impl<T: ?Sized + RefUnwindSafe> RefUnwindSafe for Id<T> {}
// TODO: Relax this bound
impl<T: ?Sized + RefUnwindSafe + UnwindSafe> UnwindSafe for Id<T> {}

#[cfg(doc)]
#[allow(unused)]
struct TestDocIdWithNonClassType {
id: Id<crate::runtime::AnyObject>,
}

#[cfg(test)]
mod tests {
use core::mem::size_of;
Expand Down

0 comments on commit fe33f6c

Please sign in to comment.