Skip to content

Commit 785c229

Browse files
authored
Simplify possible scopes for Cargo
1 parent 34d4386 commit 785c229

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

text/3127-trim-paths.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -104,24 +104,21 @@ Debug information are written to split files when the separate codegen option `-
104104

105105
## Cargo
106106

107-
`trim-paths` is a profile setting which enables and controls the sanitisation of file paths in compilation outputs. It corresponds to the `--remap-path-scope` flag of rustc and accepts all valid scope, or combination of scopes that `--remap-path-scope` accepts, in addition to the `none` or `false` option which disables path sanitisation completely. Possible values are:
107+
`trim-paths` is a profile setting which enables and controls the sanitisation of file paths in build outputs. It is a simplified version of rustc's `--remap-path-scope`. It takes a comma separated list of the following values:
108108

109109
- `none` and `false` - disable path sanitisation
110110
- `macro` - sanitise paths in the expansion of `std::file!()` macro. This is where paths in embedded panic messages come from
111111
- `diagnostics` - sanitise paths in printed compiler diagnostics
112-
- `unsplit-debuginfo` - sanitise paths in debug information in compiled executables or libraries. Does nothing if debug information are in split files
113-
- `split-debuginfo` - sanitise paths in debug information in split debuginfo files. Does nothing if debug information are in compiled executables or libraries
114-
- `split-debuginfo-path` - sanitise paths pointing to split debug information files. Does nothing if these files are not generated.
115-
- `object` - an alias for `macro,unsplit-debuginfo,split-debuginfo-path`. This ensures all paths in compiled executables or libraries are sanitised, but not elsewhere.
116-
- `all` and `true` - an alias for all of the above
112+
- `object` - sanitise paths in compiled executables or libraries
113+
- `all` and `true` - sanitise paths in all possible locations
117114

118115
It is defaulted to `none` for debug profiles, and `object` for release profiles. You can manually override it by specifying this option in `Cargo.toml`:
119116
```toml
120117
[profile.dev]
121-
trim-paths = all
118+
trim-paths = "all"
122119

123120
[profile.release]
124-
trim-paths = none
121+
trim-paths = "none"
125122
```
126123

127124
The default release profile setting (`object`) sanitises only the paths in emitted executable or library files. It always affects paths from macros such as panic messages, and in debug information

0 commit comments

Comments
 (0)