# Intra-doc links for keywords

**URL:** <https://internals.rust-lang.org/t/intra-doc-links-for-keywords/14654>\
**Category:** tools and infrastructure\
**Created:** [May 8, 2021, 5:08pm UTC](https://internals.rust-lang.org/t/intra-doc-links-for-keywords/14654 "2021-05-08T17:08:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dherman](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/dherman/32/4511_2.png) [@dherman](https://internals.rust-lang.org/u/dherman)\
**Post date:** [May 8, 2021, 5:08pm UTC](https://internals.rust-lang.org/t/intra-doc-links-for-keywords/14654/1 "2021-05-08T17:08:39Z")

</div>

I see in this [issue about intra-doc links for `true` and `false`](https://github.com/rust-lang/rust/issues/74515) that rustdoc doesn't currently support intra-doc links for keywords in general, and it seems several folks were pretty strongly against it. I'm curious what the rationale is?

In working on the API docs for [Neon](https://neon-bindings.com), which is a library that specifically tries to cater to new Rust programmers, and I'd like to be able to link to the `move` keyword in the standard API docs to explain common usage patterns like spawning threads with a `move` closure.

I can of course hard-code the link to the official URL, but not having support from the tooling the way primitive types do makes me wonder if I'm doing something that's considered bad practice. Our docs already use intra-doc links for things like `pointer` and `reference`, so I was surprised when `move` didn't work.

Looking forward to hearing folks' thoughts, thanks!

---

<div class="post-metadata">

**Author:** ![jyn514](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/jyn514/32/13245_2.png) [@jyn514](https://internals.rust-lang.org/u/jyn514)\
**Post date:** [May 8, 2021, 5:11pm UTC](https://internals.rust-lang.org/t/intra-doc-links-for-keywords/14654/2 "2021-05-08T17:11:57Z")

</div>

Some prior discussion: [Discord](https://discord.com/channels/442252698964721669/459149107387170817/840634848254230538)

Also, looking back at this I think allowing true and false was not a great decision, it seems like a weird special case especially since it generates a link to bool instead.

---

<div class="post-metadata">

**Author:** ![Nemo157](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/nemo157/32/11585_2.png) [@Nemo157](https://internals.rust-lang.org/u/Nemo157)\
**Post date:** [May 8, 2021, 9:10pm UTC](https://internals.rust-lang.org/t/intra-doc-links-for-keywords/14654/3 "2021-05-08T21:10:38Z")

</div>

`true` and `false` can be rationalised as linking to [the variants of `enum bool { true, false }`](https://github.com/rust-lang/rfcs/issues/348). Similarly `pointer` and `reference` make sense as links to the otherwise unnameable type constructors `*const _` and `&_` respectively (I'm slightly surprised that with [the support for generic parameters](https://github.com/rust-lang/rust/issues/62834) `[`*const T`]` and similar doesn't work now). Those are all "types" or "values" that should have pages in the library documentation.

`move` and other keywords feel different. They are part of the _language_, so if there were a way to link to them I would expect those links to go to the language reference page, which is a rather large difference from how the rest of intra-doc links work.

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/system/32/14092_2.png) [@system](https://internals.rust-lang.org/u/system)\
**Post date:** [August 6, 2021, 9:10pm UTC](https://internals.rust-lang.org/t/intra-doc-links-for-keywords/14654/4 "2021-08-06T21:10:52Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
