Browse Source

doc: fix rustdoc link in macro

`$wrapper` is not visible to rustdoc before expansion. Build the link
after expansion.
Tamir Duberstein 1 week ago
parent
commit
8ee12d337f
1 changed files with 3 additions and 1 deletions
  1. 3 1
      aya/src/programs/links.rs

+ 3 - 1
aya/src/programs/links.rs

@@ -546,7 +546,9 @@ macro_rules! define_link_wrapper {
             /// Takes ownership of the link referenced by the provided `link_id`.
             /// Takes ownership of the link referenced by the provided `link_id`.
             ///
             ///
             /// The caller takes the responsibility of managing the lifetime of the link. When the
             /// The caller takes the responsibility of managing the lifetime of the link. When the
-            /// returned [`$wrapper`] is dropped, the link is detached.
+            /// returned
+            #[doc = concat!("[`", stringify!($wrapper), "`]")]
+            /// is dropped, the link will be detached.
             pub fn take_link(&mut self, link_id: $wrapper_id) -> Result<$wrapper, ProgramError> {
             pub fn take_link(&mut self, link_id: $wrapper_id) -> Result<$wrapper, ProgramError> {
                 self.data.links.forget(link_id)
                 self.data.links.forget(link_id)
             }
             }