Skip to content

Commit 33ed787

Browse files
talk about --linker
1 parent f9d3845 commit 33ed787

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/doc/rustdoc/src/unstable-features.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,3 +266,16 @@ $ rustdoc src/lib.rs -Z unstable-options --crate-version 1.3.37
266266
When `rustdoc` receives this flag, it will print an extra "Version (version)" into the sidebar of
267267
the crate root's docs. You can use this flag to differentiate between different versions of your
268268
library's documentation.
269+
270+
### `--linker`: control the linker used for documentation tests
271+
272+
Using this flag looks like this:
273+
274+
```bash
275+
$ rustdoc --test src/lib.rs -Z unstable-options --linker foo
276+
$ rustdoc --test README.md -Z unstable-options --linker foo
277+
```
278+
279+
When `rustdoc` runs your documentation tests, it needs to compile and link the tests as executables
280+
before running them. This flag can be used to change the linker used on these executables. It's
281+
equivalent to passing `-C linker=foo` to `rustc`.

0 commit comments

Comments
 (0)