]> git.lizzy.rs Git - rust.git/commitdiff
talk about --linker
authorQuietMisdreavus <grey@quietmisdreavus.net>
Fri, 16 Mar 2018 18:46:10 +0000 (13:46 -0500)
committerQuietMisdreavus <grey@quietmisdreavus.net>
Fri, 16 Mar 2018 18:46:10 +0000 (13:46 -0500)
src/doc/rustdoc/src/unstable-features.md

index 867e4585d9c1e91fdf84335c361f0d17738e8fea..870d77895fd6edc402b00a5ddf9e3714c53ee039 100644 (file)
@@ -266,3 +266,16 @@ $ rustdoc src/lib.rs -Z unstable-options --crate-version 1.3.37
 When `rustdoc` receives this flag, it will print an extra "Version (version)" into the sidebar of
 the crate root's docs. You can use this flag to differentiate between different versions of your
 library's documentation.
+
+### `--linker`: control the linker used for documentation tests
+
+Using this flag looks like this:
+
+```bash
+$ rustdoc --test src/lib.rs -Z unstable-options --linker foo
+$ rustdoc --test README.md -Z unstable-options --linker foo
+```
+
+When `rustdoc` runs your documentation tests, it needs to compile and link the tests as executables
+before running them. This flag can be used to change the linker used on these executables. It's
+equivalent to passing `-C linker=foo` to `rustc`.