Skip to content

Commit bff8668

Browse files
committed
[beta] Remove strip = "off" (and undocumented strip = "n"/strip = "no")
The `strip` option allows the string `"off"`, which `rustc` doesn't have, and maps it to `"none"`. Remove that equivalent, and just keep `"none"`. Simplify and clarify the documentation for `strip` accordingly. `strip` reused the `is_off` function from `lto`, which also had the net effect of allowing `"n"` and `"no"`, which weren't documented as supported. This change drops those as well.
1 parent 5ad495c commit bff8668

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/cargo/core/profiles.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,7 @@ fn merge_profile(profile: &mut Profile, toml: &TomlProfile) {
629629
profile.strip = match toml.strip {
630630
Some(StringOrBool::Bool(true)) => Strip::Named(InternedString::new("symbols")),
631631
None | Some(StringOrBool::Bool(false)) => Strip::None,
632-
Some(StringOrBool::String(ref n)) if is_off(n.as_str()) => Strip::None,
632+
Some(StringOrBool::String(ref n)) if n.as_str() == "none" => Strip::None,
633633
Some(StringOrBool::String(ref n)) => Strip::Named(InternedString::new(n)),
634634
};
635635
}

src/doc/src/reference/profiles.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,12 +106,12 @@ strip either symbols or debuginfo from a binary. This can be enabled like so:
106106
strip = "debuginfo"
107107
```
108108

109-
Other possible string values of `strip` are `none`, `symbols`, and `off`. The
110-
default is `none`.
109+
Possible string values of `strip` are `"none"`, `"debuginfo"`, and `"symbols"`.
110+
The default is `"none"`.
111111

112-
You can also configure this option with the two absolute boolean values
113-
`true` and `false`. The former enables `strip` at its higher level, `symbols`,
114-
while the latter disables `strip` completely.
112+
You can also configure this option with the boolean values `true` or `false`.
113+
`strip = true` is equivalent to `strip = "symbols"`. `strip = false` is
114+
equivalent to `strip = "none"` and disables `strip` completely.
115115

116116
[`-C strip` flag]: ../../rustc/codegen-options/index.html#strip
117117

0 commit comments

Comments
 (0)