Skip to content

Commit 8e6ff71

Browse files
committed
scylla-macros: Add a warning about links in doc comments
1 parent 994d578 commit 8e6ff71

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

scylla-macros/src/lib.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
// WARNING FOR CONTRIBUTORS
2+
// Doc comments in this file use a different syntax than normally.
3+
// Typically you use [some_item](other_crate::path::to::some_item), but this
4+
// requires `other_crate` to be a dependency of the crate where the
5+
// doc comment is located.
6+
// `scylla` and `scylla-cql` can not be dependencies of `scylla-macros`,
7+
// so we can't use that here. The workaround is to use a relative link
8+
// to the html files of the item you want to link - see existing doc comments
9+
// in this file for examples of that. This way the links work in docs for
10+
// `scylla` and `scylla-cql` crates (but not in `scylla-macros` crate - nothing
11+
// we can do about that).
12+
// There are 2 footguns you need to be careful with because of this solutin:
13+
// - rustdoc can't verify if the links are correct. When you add / modify
14+
// a link, you need to open the generated docs, and verify that it works
15+
// both in `scylla` and `scylla-cql`.
16+
// - Such relative links only work at a given depth, so the macros need to
17+
// be re-exported at given depth. Currently, the links assume depth 1, in other
18+
// words the items must be in the crate root (e.g. `scylla::SerializeRow`).
19+
120
use darling::{FromMeta, ToTokens};
221
use proc_macro::TokenStream;
322

0 commit comments

Comments
 (0)