Skip to content

Commit b5b0ed4

Browse files
committed
Fix doc links
1 parent 00694f3 commit b5b0ed4

File tree

5 files changed

+22
-13
lines changed

5 files changed

+22
-13
lines changed

objc2/src/foundation/__ns_string.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ impl CachedNSString {
305305
/// Because of that, this should be preferred over [`NSString::from_str`]
306306
/// where possible.
307307
///
308-
/// [`NSString::from_str`]: crate::NSString::from_str
308+
/// [`NSString::from_str`]: crate::foundation::NSString::from_str
309309
#[macro_export]
310310
macro_rules! ns_string {
311311
($s:expr) => {{

objc2/src/foundation/copying.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ pub unsafe trait NSCopying: Message {
2121
/// `copy` message (and others) does not create a new instance, but
2222
/// instead just retains the instance).
2323
///
24-
/// [`NSString`]: crate::NSString
24+
/// [`NSString`]: crate::foundation::NSString
2525
type Ownership: Ownership;
2626

2727
/// The output type.

objc2/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
//! other type, and this would trigger undefined behaviour!
7676
//!
7777
//! Making the ergonomics better is something that is currently being worked
78-
//! on, the [`objc2::foundation`] module contains more ergonomic usage of at
78+
//! on, the [`foundation`] module contains more ergonomic usage of at
7979
//! least parts of the `Foundation` framework.
8080
//!
8181
//! Anyhow, all of this `unsafe` nicely leads us to another feature that this
@@ -85,6 +85,7 @@
8585
//! [`runtime::Object`]: crate::runtime::Object
8686
//! [`rc::Owned`]: crate::rc::Owned
8787
//! [`rc::Id`]: crate::rc::Id
88+
//! [`foundation`]: crate::foundation
8889
//!
8990
//!
9091
//! ## Encodings and message type verification

objc2/src/macros/declare_class.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ macro_rules! __inner_declare_class {
235235
/// Declare a new Objective-C class.
236236
///
237237
/// This is mostly just a convenience macro on top of [`extern_class!`] and
238-
/// the functionality in the [`objc2::declare`] module, but it can really help
238+
/// the functionality in the [`declare`] module, but it can really help
239239
/// with cutting down on boilerplate, in particular when defining delegate
240240
/// classes!
241241
///
@@ -250,7 +250,7 @@ macro_rules! __inner_declare_class {
250250
///
251251
/// The class definition works a lot like [`extern_class!`], with the added
252252
/// functionality that you can define custom instance variables on your class,
253-
/// which are then wrapped in a [`objc2::runtime::Ivar`] and made accessible
253+
/// which are then wrapped in a [`declare::Ivar`] and made accessible
254254
/// through the class. (E.g. you can use `self.my_ivar` as if it was a normal
255255
/// Rust struct).
256256
///
@@ -277,10 +277,11 @@ macro_rules! __inner_declare_class {
277277
/// A transformation step is performed on the functions (to make them have the
278278
/// correct ABI) and hence they shouldn't really be called manually. (You
279279
/// can't mark them as `pub` for the same reason). Instead, define a new
280-
/// function that calls it via. [`objc2::msg_send!`].
280+
/// function that calls it via. [`msg_send!`].
281281
///
282282
/// ["associated functions"]: https://doc.rust-lang.org/reference/items/associated-items.html#methods
283283
/// ["methods"]: https://doc.rust-lang.org/reference/items/associated-items.html#methods
284+
/// [`msg_send!`]: crate::msg_send
284285
///
285286
///
286287
/// ## Protocol definition
@@ -456,6 +457,8 @@ macro_rules! __inner_declare_class {
456457
/// ```
457458
///
458459
/// [`extern_class!`]: crate::extern_class
460+
/// [`declare`]: crate::declare
461+
/// [`declare::Ivar`]: crate::declare::Ivar
459462
#[doc(alias = "@interface")]
460463
#[doc(alias = "@implementation")]
461464
#[macro_export]

objc2/src/macros/extern_class.rs

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,26 @@
33
/// This is similar to an `@interface` declaration in Objective-C.
44
///
55
/// The given struct name should correspond to a valid Objective-C class,
6-
/// whose instances have the encoding [`objc2::Encoding::Object`].
7-
/// (as an example: `NSAutoreleasePool` does not have this!)
6+
/// whose instances have the encoding [`Encoding::Object`]. (as an example:
7+
/// `NSAutoreleasePool` does not have this!)
88
///
99
/// You must specify the superclass of this class, similar to how you would
1010
/// in Objective-C. Due to Rust trait limitations, specifying e.g. the
1111
/// superclass `NSData` would not give you easy access to `NSObject`'s
1212
/// functionality, therefore you may specify additional parts of the
1313
/// inheritance chain.
1414
///
15+
/// [`Encoding::Object`]: crate::Encoding::Object
16+
///
1517
///
1618
/// # Specification
1719
///
1820
/// This creates an opaque struct containing the superclass (which means that
1921
/// auto traits are inherited from the superclass), and implements the
2022
/// following traits for it to allow easier usage as an Objective-C object:
2123
///
22-
/// - [`objc2::RefEncode`]
23-
/// - [`objc2::Message`]
24+
/// - [`RefEncode`][crate::RefEncode]
25+
/// - [`Message`][crate::Message]
2426
/// - [`Deref<Target = $superclass>`][core::ops::Deref]
2527
/// - [`DerefMut`][core::ops::DerefMut]
2628
/// - [`AsRef<$inheritance_chain>`][AsRef]
@@ -33,19 +35,22 @@
3335
/// `class!(MyObject)`.
3436
///
3537
/// The macro allows specifying fields on the struct, but _only_ zero-sized
36-
/// types like [`PhantomData`] and [`objc2::declare::Ivar`] are allowed here!
38+
/// types like [`PhantomData`] and [`declare::Ivar`] are allowed here!
3739
///
3840
/// [`PhantomData`]: core::marker::PhantomData
41+
/// [`declare::Ivar`]: crate::declare::Ivar
3942
///
4043
///
4144
/// # Safety
4245
///
4346
/// The specified superclass must be correct. The object must also respond to
44-
/// standard memory management messages (this is upheld if `NSObject` is part
45-
/// of its inheritance chain).
47+
/// standard memory management messages (this is upheld if [`NSObject`] is
48+
/// part of its inheritance chain).
4649
///
4750
/// Additionally, any fields (if specified) must be zero-sized.
4851
///
52+
/// [`NSObject`]: crate::foundation::NSObject
53+
///
4954
///
5055
/// # Example
5156
///

0 commit comments

Comments
 (0)