Skip to content

Commit fe33f6c

Browse files
committed
Add test to ensure that documenting auto traits of Id<AnyObject> works
1 parent 9b30f3b commit fe33f6c

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

crates/objc2/src/rc/id.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -761,8 +761,7 @@ mod private {
761761
}
762762

763763
/// Helper struct for avoiding a gnarly ICE in `rustdoc` when generating
764-
/// documentation for `icrate` iterator helpers (in particular, it fails
765-
/// in generating auto trait implementations).
764+
/// documentation for auto traits for `Id<T>` where `T: !ClassType`.
766765
///
767766
/// See related issues:
768767
/// - <https://github.com/rust-lang/rust/issues/91380>
@@ -822,6 +821,12 @@ impl<T: ?Sized + RefUnwindSafe> RefUnwindSafe for Id<T> {}
822821
// TODO: Relax this bound
823822
impl<T: ?Sized + RefUnwindSafe + UnwindSafe> UnwindSafe for Id<T> {}
824823

824+
#[cfg(doc)]
825+
#[allow(unused)]
826+
struct TestDocIdWithNonClassType {
827+
id: Id<crate::runtime::AnyObject>,
828+
}
829+
825830
#[cfg(test)]
826831
mod tests {
827832
use core::mem::size_of;

0 commit comments

Comments
 (0)