Skip to content

Commit 3f59b7b

Browse files
committed
Add option rationales
1 parent 8ba3510 commit 3f59b7b

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

text/3127-trim-paths.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,22 @@ An alternative is to extend the syntax accepted by `--remap-path-prefix` or add
288288
scoping rules to be explicitly applied to each remapping. This can co-exist with `--remap-path-scope` so it will be discussed further in
289289
[Future possibilities](#future-possibilities) section.
290290

291+
## Rationale for the `--remap-path-scope` options
292+
There are quite a few options available for `--remap-path-scope`. Not all of them are expected to have meaningful use-cases in their own right.
293+
Some are only added for completeness, that is, the behaviour of `--remap-path-prefix=all` (or the original `--remap-path-prefix` on its own) is
294+
the same as specifying all individual scopes. In the future, we expect some of the scopes to be removed as independent options, while preserving
295+
the behaviour of `--remap-path-prefix=all` and the stable `--remap-path-prefix`, which is "Remap source names in all output".
296+
297+
- `macro` is primarily meant for panic messages embedded in binaries.
298+
- `diagnostics` is unlikely to be used on its own as it only affects console outputs, but is required for completeness. See [#87745](https://github.com/rust-lang/rust/issues/87745).
299+
- `unsplit-debuginfo` is used to sanitise debuginfo embedded in binaries.
300+
- `split-debuginfo` is used to sanitise debuginfo separate from binaries. This is may be used when debuginfo files are separate and the author
301+
still wants to distribute them.
302+
- `split-debuginfo-path` is used to sanitise the path embedded in binaries pointing to separate debuginfo files. This is likely needed in all
303+
contexts where `unsplit-debuginfo` is used, but it's technically a separate piece of information inserted by the linker, not rustc.
304+
- `object` is a shorthand for the most common use-case: sanitise everything in binaries, but nowhere else.
305+
- `all` and `true` preserves the documented behaviour of `--remap-path-prefix`.
306+
291307
# Prior art
292308
[prior-art]: #prior-art
293309

0 commit comments

Comments
 (0)