about summary refs log tree commit diff
diff options
context:
space:
mode:
authordanakj <danakj@chromium.org>2021-09-07 15:38:29 -0400
committerdanakj <danakj@chromium.org>2021-09-07 15:41:30 -0400
commit2a687deee872917b09519519290521fa8dd472b7 (patch)
tree95d09f26ddd5a8c15a7c301330f822ce18f26614
parentce35f8ec56ec7e89d351cd95001f4d819c97e07d (diff)
downloadrust-2a687deee872917b09519519290521fa8dd472b7.tar.gz
rust-2a687deee872917b09519519290521fa8dd472b7.zip
Move documentation to the unstable book
-rw-r--r--src/doc/rustc/src/command-line-arguments.md13
-rw-r--r--src/doc/unstable-book/src/compiler-flags/remap-cwd-prefix.md24
2 files changed, 24 insertions, 13 deletions
diff --git a/src/doc/rustc/src/command-line-arguments.md b/src/doc/rustc/src/command-line-arguments.md
index f38b4ca744f..7f482f0f2b1 100644
--- a/src/doc/rustc/src/command-line-arguments.md
+++ b/src/doc/rustc/src/command-line-arguments.md
@@ -345,19 +345,6 @@ replacement is purely textual, with no consideration of the current system's
 pathname syntax. For example `--remap-path-prefix foo=bar` will match
 `foo/lib.rs` but not `./foo/lib.rs`.
 
-<a id="option-remap-cwd-prefix"></a>
-## `--remap-cwd-prefix`: remap paths under the cwd in output
-
-Remap all absolute paths that are rooted under the current working directory to
-be under the given value instead. The given value may be absolute or relative,
-or empty. This switch takes precidence over `--remap-path-prefix` in case they
-would both match a given path.
-
-This flag allows the command line to be universally reproducible, such that the
-same execution will work on all machines, regardless of build environment.
-
-This is an unstable option. Use `-Z remap-cwd-prefix=val` to specify a value.
-
 <a id="option-json"></a>
 ## `--json`: configure json messages printed by the compiler
 
diff --git a/src/doc/unstable-book/src/compiler-flags/remap-cwd-prefix.md b/src/doc/unstable-book/src/compiler-flags/remap-cwd-prefix.md
new file mode 100644
index 00000000000..977d258529f
--- /dev/null
+++ b/src/doc/unstable-book/src/compiler-flags/remap-cwd-prefix.md
@@ -0,0 +1,24 @@
+# `remap-cwd-prefix`
+
+The tracking issue for this feature is: [#87325](https://github.com/rust-lang/rust/issues/87325).
+
+------------------------
+
+This flag will rewrite absolute paths under the current working directory,
+replacing the current working directory prefix with a specified value.
+
+The given value may be absolute or relative, or empty. This switch takes
+precidence over `--remap-path-prefix` in case they would both match a given
+path.
+
+This flag helps to produce deterministic output, by removing the current working
+directory from build output, while allowing the command line to be universally
+reproducible, such that the same execution will work on all machines, regardless
+of build environment.
+
+## Example
+```sh
+# This would produce an absolute path to main.rs in build outputs of
+# "./main.rs".
+rustc -Z remap-cwd-prefix=. main.rs
+```