Skip to content

Commit 67a2f37

Browse files
committed
Add documentation for --remap-path-prefix and doc scope in rustdoc
1 parent 2bdb6b3 commit 67a2f37

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -751,6 +751,22 @@ pass `--doctest-build-arg ARG` for each argument `ARG`.
751751

752752
This flag enables the generation of toggles to expand macros in the HTML source code pages.
753753

754+
## `--remap-path-prefix`: Remap source code paths in output
755+
756+
This flag is the equivalent flag from `rustc` `--remap-path-prefix`.
757+
758+
it permits remapping source path prefixes in all output, including compiler diagnostics,
759+
debug information, macro expansions, etc. It takes a value of the form `FROM=TO`
760+
where a path prefix equal to `FROM` is rewritten to the value `TO`.
761+
762+
### `documentation` scope
763+
764+
`rustdoc` (and by extension `rustc`) have a special `documentation` remapping scope, it
765+
permits remapping source paths that ends up in the generated documentation.
766+
767+
Currently the scope can only be specified from `rustc`, due to the lack of an equivalent
768+
`--remap-path-scope` flag in `rustc`.
769+
754770
## `#[doc(cfg)]` and `#[doc(auto_cfg)]`
755771

756772
This feature aims at providing rustdoc users the possibility to add visual markers to the rendered documentation to know under which conditions an item is available (currently possible through the following unstable feature: `doc_cfg`).

0 commit comments

Comments
 (0)