···7878> ```md
7979> | Phantom type | variance of `T` |
8080> | :------------------------------------------------- | :---------------- |
8181-> | [`&'a mut T`][std::marker::PhantomData<&'a mut T>] | **inv**ariant |
8181+> | [`&'a mut T`][std::marker::PhantomData<&'a mut T>] | **in**variant |
8282> | [`fn(T)`][std::marker::PhantomData<fn(T)>] | **contra**variant |
8383> ```
8484>
8585> | Phantom type | variance of `T` |
8686> | :------------------------------------------------- | :---------------- |
8787-> | [`&'a mut T`](https://doc.rust-lang.org/stable/core/marker/struct.PhantomData.html "std::marker::PhantomData<&'a mut T>") | **inv**ariant |
8787+> | [`&'a mut T`](https://doc.rust-lang.org/stable/core/marker/struct.PhantomData.html "std::marker::PhantomData<&'a mut T>") | **in**variant |
8888> | [`fn(T)`](https://doc.rust-lang.org/stable/core/marker/struct.PhantomData.html "std::marker::PhantomData<fn(T)>") | **contra**variant |
89899090This includes if you use turbofish:
···163163> [`std::vec`], [`mod@std::vec`], and [`macro@std::vec`] all link to the `vec` _module_.
164164> ```
165165>
166166-> [`std::vec`](https://doc.rust-lang.org/stable/alloc/vec/index.html "std::vec"), [`mod@std::vec`](https://doc.rust-lang.org/stable/alloc/vec/index.html "mod@std::vec"), and [`macro@std::vec`](https://doc.rust-lang.org/stable/alloc/vec/index.html "macro@std::vec") all link to the `vec` >
167167-> _module_.
166166+> [`std::vec`](https://doc.rust-lang.org/stable/alloc/vec/index.html "std::vec"), [`mod@std::vec`](https://doc.rust-lang.org/stable/alloc/vec/index.html "mod@std::vec"), and [`macro@std::vec`](https://doc.rust-lang.org/stable/alloc/vec/index.html "macro@std::vec") all link to the `vec` _module_.
168167169168Currently, duplicate names in Rust are allowed only if they correspond to items in
170169different [namespaces], for example, between macros and modules, and between struct
···4747 74 │ > ```md
4848 75 │ > | Phantom type | variance of `T` |
4949 76 │ > | :------------------------------------------------- | :---------------- |
5050- 77 │ > | [`&'a mut T`][std::marker::PhantomData<&'a mut T>] | **inv**ariant |
5050+ 77 │ > | [`&'a mut T`][std::marker::PhantomData<&'a mut T>] | **in**variant |
5151 78 │ > | [`fn(T)`][std::marker::PhantomData<fn(T)>] | **contra**variant |
5252 79 │ > ```
5353 80 │ >
5454 81 │ > | Phantom type | variance of `T` |
5555 82 │ > | :------------------------------------------------- | :---------------- |
5656- 83 │ > | [`&'a mut T`][std::marker::PhantomData<&'a mut T>] | **inv**ariant |
5656+ 83 │ > | [`&'a mut T`][std::marker::PhantomData<&'a mut T>] | **in**variant |
5757 · ─────────────────────────┬────────────────────────
5858 · ╰── https://doc.rust-lang.org/stable/core/marker/struct.PhantomData.html
5959 84 │ > | [`fn(T)`][std::marker::PhantomData<fn(T)>] | **contra**variant |
···160160 159 │ > [`std::vec`], [`mod@std::vec`], and [`macro@std::vec`] all link to the `vec` _module_.
161161 160 │ > ```
162162 161 │ >
163163- 162 │ > [`std::vec`], [`mod@std::vec`], and [`macro@std::vec`] all link to the `vec` >
163163+ 162 │ > [`std::vec`], [`mod@std::vec`], and [`macro@std::vec`] all link to the `vec` _module_.
164164 · ──────┬───── ────────┬─────── ─────────┬────────
165165 · │ │ ╰── https://doc.rust-lang.org/stable/alloc/vec/index.html
166166 · │ ╰── https://doc.rust-lang.org/stable/alloc/vec/index.html
167167 · ╰── https://doc.rust-lang.org/stable/alloc/vec/index.html
168168- 163 │ > _module_.
169169- 164 │
170170- 165 │ Currently, duplicate names in Rust are allowed only if they correspond to items in
171171- 166 │ different [namespaces], for example, between macros and modules, and between struct
172172- 167 │ fields and methods — this is mostly covered by the function and macro syntax, described
173173- 168 │ [above](#functions-and-macros).
174174- 169 │
175175- 170 │ If you encounter items that must be disambiguated using rustdoc's disambiguator syntax,
176176- 171 │ other than [the "special types" listed below](#special-types), please [file an
177177- 172 │ issue][gh-issues]!
178178- 173 │
179179- 174 │ ## Special types
180180- 175 │
181181- 176 │ > [!WARNING]
182182- 177 │
183183- 178 │ There is **no support** on types whose syntax is not a path; they are currently not
184184- 179 │ parsed at all:
185185- 180 │
186186- 181 │ > references `&T`, slices `[T]`, arrays `[T; N]`, tuples `(T1, T2)`, pointers like
187187- 182 │ > `*const T`, trait objects like `dyn Any`, and the never type `!`
188188- 183 │
189189- 184 │ Note that such types can still be used as generic params, just not as standalone types.
190190- 185 │
191191- 186 │ ## Struct fields
192192- 187 │
193193- 188 │ > [!WARNING]
194194- 189 │
195195- 190 │ Linking to struct fields is **not supported** yet. This is **incompatible** with
196196- 191 │ rustdoc.
197197- 192 │
198198- 193 │ ## Markdown link syntax
199199- 194 │
200200- 195 │ All Markdown link formats supported by rustdoc are supported:
201201- 196 │
202202- 197 │ Linking with URL inlined:
203203- 198 │
204204- 199 │ > ```md
205205- 200 │ > [The Option type](std::option::Option)
206206- 201 │ > ```
207207- 202 │ >
208208- 203 │ > [The Option type](std::option::Option)
168168+ 163 │
169169+ 164 │ Currently, duplicate names in Rust are allowed only if they correspond to items in
170170+ 165 │ different [namespaces], for example, between macros and modules, and between struct
171171+ 166 │ fields and methods — this is mostly covered by the function and macro syntax, described
172172+ 167 │ [above](#functions-and-macros).
173173+ 168 │
174174+ 169 │ If you encounter items that must be disambiguated using rustdoc's disambiguator syntax,
175175+ 170 │ other than [the "special types" listed below](#special-types), please [file an
176176+ 171 │ issue][gh-issues]!
177177+ 172 │
178178+ 173 │ ## Special types
179179+ 174 │
180180+ 175 │ > [!WARNING]
181181+ 176 │
182182+ 177 │ There is **no support** on types whose syntax is not a path; they are currently not
183183+ 178 │ parsed at all:
184184+ 179 │
185185+ 180 │ > references `&T`, slices `[T]`, arrays `[T; N]`, tuples `(T1, T2)`, pointers like
186186+ 181 │ > `*const T`, trait objects like `dyn Any`, and the never type `!`
187187+ 182 │
188188+ 183 │ Note that such types can still be used as generic params, just not as standalone types.
189189+ 184 │
190190+ 185 │ ## Struct fields
191191+ 186 │
192192+ 187 │ > [!WARNING]
193193+ 188 │
194194+ 189 │ Linking to struct fields is **not supported** yet. This is **incompatible** with
195195+ 190 │ rustdoc.
196196+ 191 │
197197+ 192 │ ## Markdown link syntax
198198+ 193 │
199199+ 194 │ All Markdown link formats supported by rustdoc are supported:
200200+ 195 │
201201+ 196 │ Linking with URL inlined:
202202+ 197 │
203203+ 198 │ > ```md
204204+ 199 │ > [The Option type](std::option::Option)
205205+ 200 │ > ```
206206+ 201 │ >
207207+ 202 │ > [The Option type](std::option::Option)
209208 · ───────────────────┬──────────────────
210209 · ╰── https://doc.rust-lang.org/stable/core/option/enum.Option.html
211211- 204 │
212212- 205 │ Linking with reusable references:
213213- 206 │
214214- 207 │ > ```md
215215- 208 │ > [The Option type][option-type]
216216- 209 │ >
217217- 210 │ > [option-type]: std::option::Option
218218- 211 │ > ```
219219- 212 │ >
220220- 213 │ > [The Option type][option-type]
210210+ 203 │
211211+ 204 │ Linking with reusable references:
212212+ 205 │
213213+ 206 │ > ```md
214214+ 207 │ > [The Option type][option-type]
215215+ 208 │ >
216216+ 209 │ > [option-type]: std::option::Option
217217+ 210 │ > ```
218218+ 211 │ >
219219+ 212 │ > [The Option type][option-type]
221220 · ───────────────┬──────────────
222221 · ╰── https://doc.rust-lang.org/stable/core/option/enum.Option.html
223223- 214 │ >
224224- 215 │ > [option-type]: std::option::Option
225225- 216 │
226226- 217 │ Reference-style links `[text][id]` without a corresponding `[id]: name` part will be
227227- 218 │ treated the same as inline-style links `[text](id)`:
228228- 219 │
229229- 220 │ > ```md
230230- 221 │ > [The Option type][std::option::Option]
231231- 222 │ > ```
232232- 223 │ >
233233- 224 │ > [The Option type][std::option::Option]
222222+ 213 │ >
223223+ 214 │ > [option-type]: std::option::Option
224224+ 215 │
225225+ 216 │ Reference-style links `[text][id]` without a corresponding `[id]: name` part will be
226226+ 217 │ treated the same as inline-style links `[text](id)`:
227227+ 218 │
228228+ 219 │ > ```md
229229+ 220 │ > [The Option type][std::option::Option]
230230+ 221 │ > ```
231231+ 222 │ >
232232+ 223 │ > [The Option type][std::option::Option]
234233 · ───────────────────┬──────────────────
235234 · ╰── https://doc.rust-lang.org/stable/core/option/enum.Option.html
236236- 225 │
237237- 226 │ Shortcuts are supported, and can contain inline markups:
238238- 227 │
239239- 228 │ > ```md
240240- 229 │ > You can create a [`Vec`] with [**`Vec::new`**], or by using the [_`vec!`_][^2] macro.
241241- 230 │ > ```
242242- 231 │ >
243243- 232 │ > You can create a [`Vec`] with [**`Vec::new`**], or by using the [_`vec!`_][^2] macro.
235235+ 224 │
236236+ 225 │ Shortcuts are supported, and can contain inline markups:
237237+ 226 │
238238+ 227 │ > ```md
239239+ 228 │ > You can create a [`Vec`] with [**`Vec::new`**], or by using the [_`vec!`_][^2] macro.
240240+ 229 │ > ```
241241+ 230 │ >
242242+ 231 │ > You can create a [`Vec`] with [**`Vec::new`**], or by using the [_`vec!`_][^2] macro.
244243 · ───┬─── ────────┬─────── ─────┬────
245244 · │ │ ╰── https://doc.rust-lang.org/stable/alloc/macros/macro.vec.html
246245 · │ ╰── https://doc.rust-lang.org/stable/alloc/vec/struct.Vec.html#method.new
247246 · ╰── https://doc.rust-lang.org/stable/alloc/vec/struct.Vec.html
248248- 233 │
249249- 234 │ (The items must still be resolvable; in this case `Vec` and `vec!` come from the
250250- 235 │ prelude.)
251251- 236 │
252252- 237 │ ## Linking to page sections
253253- 238 │
254254- 239 │ To link to a known section on a page, use a URL fragment, just like a normal link. This
255255- 240 │ is _compatible_ with rustdoc.
256256- 241 │
257257- 242 │ <!-- prettier-ignore-start -->
258258- 243 │
259259- 244 │ > ```md
260260- 245 │ > [When Should You Use Which Collection?][std::collections#when-should-you-use-which-collection]
261261- 246 │ > ```
262262- 247 │ >
263263- 248 │ > [When Should You Use Which Collection?][std::collections#when-should-you-use-which-collection]
247247+ 232 │
248248+ 233 │ (The items must still be resolvable; in this case `Vec` and `vec!` come from the
249249+ 234 │ prelude.)
250250+ 235 │
251251+ 236 │ ## Linking to page sections
252252+ 237 │
253253+ 238 │ To link to a known section on a page, use a URL fragment, just like a normal link. This
254254+ 239 │ is _compatible_ with rustdoc.
255255+ 240 │
256256+ 241 │ <!-- prettier-ignore-start -->
257257+ 242 │
258258+ 243 │ > ```md
259259+ 244 │ > [When Should You Use Which Collection?][std::collections#when-should-you-use-which-collection]
260260+ 245 │ > ```
261261+ 246 │ >
262262+ 247 │ > [When Should You Use Which Collection?][std::collections#when-should-you-use-which-collection]
264263 · ───────────────────────────────────────────────┬──────────────────────────────────────────────
265264 · ╰── https://doc.rust-lang.org/stable/std/collections/index.html
266266- 249 │
267267- 250 │ <!-- prettier-ignore-end -->
268268- 251 │
269269- 252 │ ---
270270- 253 │
271271- 254 │ [^1]:
272272- 255 │ rust-analyzer's ability to generate links for enum variants like `Option::Some` was
273273- 256 │ improved only somewhat recently: before
274274- 257 │ [#19246](https://github.com/rust-lang/rust-analyzer/pull/19246), links for variants
275275- 258 │ and associated items may only point to the types themselves. If linking to such
276276- 259 │ items doesn't seem to work for you, be sure to upgrade to a newer rust-analyzer
277277- 260 │ first!
278278- 261 │
279279- 262 │ [^2]:
280280- 263 │ As of rust-analyzer <ra-version>(version)</ra-version>, links generated for macros
281281- 264 │ don't always work. Examples include [`std::format!`] (seen above) and
265265+ 248 │
266266+ 249 │ <!-- prettier-ignore-end -->
267267+ 250 │
268268+ 251 │ ---
269269+ 252 │
270270+ 253 │ [^1]:
271271+ 254 │ rust-analyzer's ability to generate links for enum variants like `Option::Some` was
272272+ 255 │ improved only somewhat recently: before
273273+ 256 │ [#19246](https://github.com/rust-lang/rust-analyzer/pull/19246), links for variants
274274+ 257 │ and associated items may only point to the types themselves. If linking to such
275275+ 258 │ items doesn't seem to work for you, be sure to upgrade to a newer rust-analyzer
276276+ 259 │ first!
277277+ 260 │
278278+ 261 │ [^2]:
279279+ 262 │ As of rust-analyzer <ra-version>(version)</ra-version>, links generated for macros
280280+ 263 │ don't always work. Examples include [`std::format!`] (seen above) and
282281 · ────────┬───────
283282 · ╰── https://doc.rust-lang.org/stable/alloc/macros/macro.format.html
284284- 265 │ [`tokio::main!`]. For more info, see [Known issues](known-issues.md#macros).
283283+ 264 │ [`tokio::main!`]. For more info, see [Known issues](known-issues.md#macros).
285284 · ────────┬───────
286285 · ╰── https://docs.rs/tokio-macros/2.5.0/tokio_macros/macro.main.html
287287- 266 │
286286+ 265 │
288287 ╰────
+3-4
docs/src/rustdoc-link/supported-syntax.md
···7474> ```md
7575> | Phantom type | variance of `T` |
7676> | :------------------------------------------------- | :---------------- |
7777-> | [`&'a mut T`][std::marker::PhantomData<&'a mut T>] | **inv**ariant |
7777+> | [`&'a mut T`][std::marker::PhantomData<&'a mut T>] | **in**variant |
7878> | [`fn(T)`][std::marker::PhantomData<fn(T)>] | **contra**variant |
7979> ```
8080>
8181> | Phantom type | variance of `T` |
8282> | :------------------------------------------------- | :---------------- |
8383-> | [`&'a mut T`][std::marker::PhantomData<&'a mut T>] | **inv**ariant |
8383+> | [`&'a mut T`][std::marker::PhantomData<&'a mut T>] | **in**variant |
8484> | [`fn(T)`][std::marker::PhantomData<fn(T)>] | **contra**variant |
85858686This includes if you use turbofish:
···159159> [`std::vec`], [`mod@std::vec`], and [`macro@std::vec`] all link to the `vec` _module_.
160160> ```
161161>
162162-> [`std::vec`], [`mod@std::vec`], and [`macro@std::vec`] all link to the `vec` >
163163-> _module_.
162162+> [`std::vec`], [`mod@std::vec`], and [`macro@std::vec`] all link to the `vec` _module_.
164163165164Currently, duplicate names in Rust are allowed only if they correspond to items in
166165different [namespaces], for example, between macros and modules, and between struct